Ignore lock surfaces from unrelated clients

gtklock doesn't mind the fact that it got denied the lock, and just creates a
new lock surface anyway. And we happily replace the running lock with it.
This commit is contained in:
Ivan Molodetskikh
2025-06-10 17:02:51 +03:00
parent a18d24fc24
commit 0407ac5e4c
+12 -2
View File
@@ -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;
}