diff options
| -rw-r--r-- | src/niri.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs index bf1cbd54..3c346553 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -5707,8 +5707,18 @@ impl Niri { } pub fn new_lock_surface(&mut self, surface: LockSurface, output: &Output) { - if matches!(self.lock_state, LockState::Unlocked) { - error!("tried to add a lock surface on an unlocked session"); + let lock = match &self.lock_state { + LockState::Unlocked => { + error!("tried to add a lock surface on an unlocked session"); + return; + } + LockState::WaitingForSurfaces { confirmation, .. } => confirmation.ext_session_lock(), + LockState::Locking(confirmation) => confirmation.ext_session_lock(), + LockState::Locked(lock) => lock, + }; + + if lock.client() != surface.wl_surface().client() { + debug!("ignoring lock surface from an unrelated client"); return; } |
