From f6f2bcd024146678c7c206903453974cd0f392dc Mon Sep 17 00:00:00 2001 From: Barret Rennie Date: Sat, 21 Oct 2017 17:03:58 -0600 Subject: Set urgent WM flag on bell on X11 systems (#812) Sets the urgent WM flag when bell is emitted on X11 systems. Additionally, the flag is cleared on focus because not all WMs clear it automatically. --- src/display.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/display.rs') diff --git a/src/display.rs b/src/display.rs index bdd9a9f2..fc5a5d40 100644 --- a/src/display.rs +++ b/src/display.rs @@ -322,6 +322,14 @@ impl Display { self.window.set_title(&title); } + if let Some(is_urgent) = terminal.next_is_urgent.take() { + // We don't need to set the urgent flag if we already have the + // user's attention. + if !is_urgent || !self.window.is_focused { + self.window.set_urgent(is_urgent); + } + } + let size_info = *terminal.size_info(); let visual_bell_intensity = terminal.visual_bell.intensity(); -- cgit v1.2.3-54-g00ecf