diff options
Diffstat (limited to 'src/window/mapped.rs')
| -rw-r--r-- | src/window/mapped.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/window/mapped.rs b/src/window/mapped.rs index 82734220..da6caf54 100644 --- a/src/window/mapped.rs +++ b/src/window/mapped.rs @@ -77,6 +77,9 @@ pub struct Mapped { /// If `None`, then the window is not offscreened. offscreen_data: RefCell<Option<OffscreenData>>, + /// Whether this has an urgent indicator. + is_urgent: bool, + /// Whether this window has the keyboard focus. is_focused: bool, @@ -231,6 +234,7 @@ impl Mapped { needs_configure: false, needs_frame_callback: false, offscreen_data: RefCell::new(None), + is_urgent: false, is_focused: false, is_active_in_column: true, is_floating: false, @@ -328,6 +332,7 @@ impl Mapped { } self.is_focused = is_focused; + self.is_urgent = false; self.need_to_recompute_rules = true; } @@ -510,6 +515,19 @@ impl Mapped { pub fn is_windowed_fullscreen(&self) -> bool { self.is_windowed_fullscreen } + + pub fn set_urgent(&mut self, urgent: bool) { + if self.is_focused && urgent { + return; + } + let changed = self.is_urgent != urgent; + self.is_urgent = urgent; + self.need_to_recompute_rules |= changed; + } + + pub fn is_urgent(&self) -> bool { + self.is_urgent + } } impl Drop for Mapped { @@ -830,6 +848,10 @@ impl LayoutElement for Mapped { } } + fn is_urgent(&self) -> bool { + self.is_urgent + } + fn set_activated(&mut self, active: bool) { let changed = self.toplevel().with_pending_state(|state| { if active { |
