diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2023-04-15 22:21:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-15 19:21:10 +0000 |
commit | ead65221ebe06ff5689e65b866d735d4365d0e9e (patch) | |
tree | e74b72bcf4d906d76dc74516a75810198a9c01d3 | |
parent | 586f982a260a1864f61f9aff6a861d3231bf3301 (diff) | |
download | alacritty-ead65221ebe06ff5689e65b866d735d4365d0e9e.tar.gz alacritty-ead65221ebe06ff5689e65b866d735d4365d0e9e.zip |
Omit urgency hint focused window
-rw-r--r-- | alacritty/src/event.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 21b866d2..c10bfed9 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -1240,10 +1240,10 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> { }, TerminalEvent::Wakeup => *self.ctx.dirty = true, TerminalEvent::Bell => { - // Set window urgency. - if self.ctx.terminal.mode().contains(TermMode::URGENCY_HINTS) { - let focused = self.ctx.terminal.is_focused; - self.ctx.window().set_urgent(!focused); + // Set window urgency hint when window is not focused. + let focused = self.ctx.terminal.is_focused; + if !focused && self.ctx.terminal.mode().contains(TermMode::URGENCY_HINTS) { + self.ctx.window().set_urgent(true); } // Ring visual bell. @@ -1324,6 +1324,7 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> { *self.ctx.dirty = true; } + // Reset the urgency hint when gaining focus. if is_focused { self.ctx.window().set_urgent(false); } |