diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-08 12:28:31 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-11-08 16:25:06 +0300 |
| commit | c0829087da6c38e693e47a8b961f7d4aaa15a91e (patch) | |
| tree | 743530c864d7f1fb2570d387cdb7470ac9a70ff6 /src | |
| parent | b6f6d6a7c24731fb8f03e797ade7805b76c334c6 (diff) | |
| download | niri-c0829087da6c38e693e47a8b961f7d4aaa15a91e.tar.gz niri-c0829087da6c38e693e47a8b961f7d4aaa15a91e.tar.bz2 niri-c0829087da6c38e693e47a8b961f7d4aaa15a91e.zip | |
Lock session right away with no outputs
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) { |
