aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-10-15 10:43:58 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-10-15 11:11:57 +0300
commita13b9298c66f45e571533731e2a690a23534df01 (patch)
tree611a04f69e856f2961409507147a1b31e887bb41 /src/niri.rs
parent0c5e046820202858e782d4bf15cbecec88e90420 (diff)
downloadniri-a13b9298c66f45e571533731e2a690a23534df01.tar.gz
niri-a13b9298c66f45e571533731e2a690a23534df01.tar.bz2
niri-a13b9298c66f45e571533731e2a690a23534df01.zip
Draw the layout as inactive when layer-shell has focus
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 4ae6d606..e553d971 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -541,14 +541,17 @@ impl State {
self.notify_blocker_cleared();
// These should be called periodically, before flushing the clients.
- self.niri.layout.refresh();
+ self.niri.popups.cleanup();
+ self.refresh_popup_grab();
+ self.update_keyboard_focus();
+
+ // Needs to be called after updating the keyboard focus.
+ self.niri.refresh_layout();
+
self.niri.cursor_manager.check_cursor_image_surface_alive();
self.niri.refresh_pointer_outputs();
- self.niri.popups.cleanup();
self.niri.global_space.refresh();
self.niri.refresh_idle_inhibit();
- self.refresh_popup_grab();
- self.update_keyboard_focus();
self.refresh_pointer_focus();
foreign_toplevel::refresh(self);
self.niri.refresh_window_rules();
@@ -2825,6 +2828,23 @@ impl Niri {
}
}
+ pub fn refresh_layout(&mut self) {
+ let layout_is_active = match &self.keyboard_focus {
+ KeyboardFocus::Layout { .. } => true,
+ KeyboardFocus::LayerShell { .. } => false,
+
+ // Draw layout as active in these cases to reduce unnecessary window animations.
+ // There's no confusion because these are both fullscreen modes.
+ //
+ // FIXME: when going into the screenshot UI from a layer-shell focus, and then back to
+ // layer-shell, the layout will briefly draw as active, despite never having focus.
+ KeyboardFocus::LockScreen { .. } => true,
+ KeyboardFocus::ScreenshotUi => true,
+ };
+
+ self.layout.refresh(layout_is_active);
+ }
+
pub fn refresh_idle_inhibit(&mut self) {
let _span = tracy_client::span!("Niri::refresh_idle_inhibit");