From a2efaf2816f14ea437d88bc6b9253b1e347c4cee Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 10 May 2025 22:48:11 +0300 Subject: Add is-urgent window rule matcher --- src/window/mapped.rs | 1 + src/window/mod.rs | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src/window') diff --git a/src/window/mapped.rs b/src/window/mapped.rs index da6caf54..74a0ea4b 100644 --- a/src/window/mapped.rs +++ b/src/window/mapped.rs @@ -520,6 +520,7 @@ impl Mapped { if self.is_focused && urgent { return; } + let changed = self.is_urgent != urgent; self.is_urgent = urgent; self.need_to_recompute_rules |= changed; diff --git a/src/window/mod.rs b/src/window/mod.rs index 71aa607b..0b94d04d 100644 --- a/src/window/mod.rs +++ b/src/window/mod.rs @@ -440,6 +440,12 @@ fn window_matches(window: WindowRef, role: &XdgToplevelSurfaceRoleAttributes, m: } } + if let Some(is_urgent) = m.is_urgent { + if window.is_urgent() != is_urgent { + return false; + } + } + if let Some(is_active) = m.is_active { // Our "is-active" definition corresponds to the window having a pending Activated state. let pending_activated = server_pending -- cgit