1
0
Fork 0
forked from wry/wry

all: implement screen locking

This commit is contained in:
Julian Orth 2022-05-19 23:39:11 +02:00
parent 9db389835d
commit d42add4d18
24 changed files with 618 additions and 6 deletions

View file

@ -15,6 +15,7 @@ use {
forker::ForkerProxy,
globals::{Globals, GlobalsError, WaylandGlobal},
ifs::{
ext_session_lock_v1::ExtSessionLockV1,
wl_drm::WlDrmGlobal,
wl_seat::{SeatIds, WlSeatGlobal},
wl_surface::{
@ -108,6 +109,7 @@ pub struct State {
pub tracker: Tracker<Self>,
pub data_offer_ids: NumCell<u64>,
pub ring: Rc<IoUring>,
pub lock: ScreenlockState,
}
// impl Drop for State {
@ -122,6 +124,11 @@ impl Debug for State {
}
}
pub struct ScreenlockState {
pub locked: Cell<bool>,
pub lock: CloneCell<Option<Rc<ExtSessionLockV1>>>,
}
pub struct XWaylandState {
pub enabled: Cell<bool>,
pub handler: RefCell<Option<SpawnedFuture<()>>>,
@ -485,6 +492,7 @@ impl State {
}
pub fn clear(&self) {
self.lock.lock.take();
self.xwayland.handler.borrow_mut().take();
self.clients.clear();
if let Some(config) = self.config.set(None) {