diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/niri.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs index 79f99858..a9210a69 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -4510,8 +4510,16 @@ impl Niri { self.cursor_manager .set_cursor_image(CursorImageStatus::default_named()); - self.lock_state = LockState::Locking(confirmation); - self.queue_redraw_all(); + if self.output_state.is_empty() { + // There are no outputs, lock the session right away. + let lock = confirmation.ext_session_lock().clone(); + confirmation.lock(); + self.lock_state = LockState::Locked(lock); + } else { + // There are outputs, which we need to redraw before locking. + self.lock_state = LockState::Locking(confirmation); + self.queue_redraw_all(); + } } pub fn unlock(&mut self) { |
