Ignore lock surfaces from unrelated clients
Browse files at this commit0407ac5e4ce67255388d7ed8d85ffdbe14ec99abParent: a18d24f1 changed file +12 -2
- src/niri.rs +12 -2
src/niri.rsmodified+12 -2
| @@ -5707,8 +5707,18 @@ impl Niri { | |||
| 5707 | } | 5707 | } |
| 5708 | 5708 | ||
| 5709 | pub fn new_lock_surface(&mut self, surface: LockSurface, output: &Output) { | 5709 | pub fn new_lock_surface(&mut self, surface: LockSurface, output: &Output) { |
| 5710 | - if matches!(self.lock_state, LockState::Unlocked) { | 5710 | + let lock = match &self.lock_state { |
| 5711 | - error!("tried to add a lock surface on an unlocked session"); | 5711 | + LockState::Unlocked => { |
| 5712 | + error!("tried to add a lock surface on an unlocked session"); | ||
| 5713 | + return; | ||
| 5714 | + } | ||
| 5715 | + LockState::WaitingForSurfaces { confirmation, .. } => confirmation.ext_session_lock(), | ||
| 5716 | + LockState::Locking(confirmation) => confirmation.ext_session_lock(), | ||
| 5717 | + LockState::Locked(lock) => lock, | ||
| 5718 | + }; | ||
| 5719 | + | ||
| 5720 | + if lock.client() != surface.wl_surface().client() { | ||
| 5721 | + debug!("ignoring lock surface from an unrelated client"); | ||
| 5712 | return; | 5722 | return; |
| 5713 | } | 5723 | } |
| 5714 | 5724 | ||