From c0829087da6c38e693e47a8b961f7d4aaa15a91e Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 8 Nov 2024 12:28:31 +0300 Subject: Lock session right away with no outputs --- src/niri.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit