aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorBarret Rennie <barret@brennie.ca>2017-10-21 17:03:58 -0600
committerJoe Wilm <jwilm@users.noreply.github.com>2017-10-21 16:03:58 -0700
commitf6f2bcd024146678c7c206903453974cd0f392dc (patch)
tree1e0f6994dbcc14325275e4d79030093f80f07b78 /src/event.rs
parentb79574ee823900c21759628f92cf036271847afc (diff)
downloadalacritty-f6f2bcd024146678c7c206903453974cd0f392dc.tar.gz
alacritty-f6f2bcd024146678c7c206903453974cd0f392dc.zip
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.
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs
index dda18652..0a79e804 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -251,6 +251,7 @@ impl<N: Notify> Processor<N> {
ref_test: bool,
resize_tx: &mpsc::Sender<(u32, u32)>,
hide_cursor: &mut bool,
+ window_is_focused: &mut bool,
) {
match event {
// Pass on device events
@@ -322,8 +323,11 @@ impl<N: Notify> Processor<N> {
processor.ctx.terminal.dirty = true;
},
Focused(is_focused) => {
+ *window_is_focused = is_focused;
+
if is_focused {
processor.ctx.terminal.dirty = true;
+ processor.ctx.terminal.next_is_urgent = Some(false);
} else {
*hide_cursor = false;
}
@@ -395,6 +399,8 @@ impl<N: Notify> Processor<N> {
mouse_bindings: &self.mouse_bindings[..],
};
+ let mut window_is_focused = window.is_focused;
+
// Scope needed to that hide_cursor isn't borrowed after the scope
// ends.
{
@@ -409,6 +415,7 @@ impl<N: Notify> Processor<N> {
ref_test,
resize_tx,
hide_cursor,
+ &mut window_is_focused,
);
};
@@ -423,6 +430,8 @@ impl<N: Notify> Processor<N> {
window.set_cursor_visible(!self.hide_cursor);
}
+ window.is_focused = window_is_focused;
+
if processor.ctx.selection_modified {
processor.ctx.terminal.dirty = true;
}