aboutsummaryrefslogtreecommitdiff
path: root/src/niri.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-03-13 11:32:54 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-03-13 14:14:54 +0300
commit1c6037e6125870205a878f5267ffb02d3b02db64 (patch)
tree990ff2844bc4d2797a66bdc241147365c8efca23 /src/niri.rs
parentfed86fdb5d097b119a3c73c8d8d974b83b49cc5a (diff)
downloadniri-1c6037e6125870205a878f5267ffb02d3b02db64.tar.gz
niri-1c6037e6125870205a878f5267ffb02d3b02db64.tar.bz2
niri-1c6037e6125870205a878f5267ffb02d3b02db64.zip
Add tiled-state window rule, update the tiled state live
Diffstat (limited to 'src/niri.rs')
-rw-r--r--src/niri.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/niri.rs b/src/niri.rs
index 6ce11e59..56582d15 100644
--- a/src/niri.rs
+++ b/src/niri.rs
@@ -646,6 +646,10 @@ impl State {
self.refresh_popup_grab();
self.update_keyboard_focus();
+ // Should be called before refresh_layout() because that one will refresh other window
+ // states and then send a pending configure.
+ self.niri.refresh_window_states();
+
// Needs to be called after updating the keyboard focus.
self.niri.refresh_layout();
@@ -3255,6 +3259,16 @@ impl Niri {
self.idle_notifier_state.set_is_inhibited(is_inhibited);
}
+ pub fn refresh_window_states(&mut self) {
+ let _span = tracy_client::span!("Niri::refresh_window_states");
+
+ let config = self.config.borrow();
+ self.layout.with_windows_mut(|mapped, _output| {
+ mapped.update_tiled_state(config.prefer_no_csd);
+ });
+ drop(config);
+ }
+
pub fn refresh_window_rules(&mut self) {
let _span = tracy_client::span!("Niri::refresh_window_rules");
@@ -3270,6 +3284,11 @@ impl Niri {
if let Some(output) = output {
outputs.insert(output.clone());
}
+
+ // Since refresh_window_rules() is called after refresh_layout(), we need to update
+ // the tiled state right here, so that it's picked up by the following
+ // send_pending_configure().
+ mapped.update_tiled_state(config.prefer_no_csd);
}
});
drop(config);