aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-05-09 20:44:14 +0000
committerGitHub <noreply@github.com>2021-05-09 20:44:14 +0000
commit0936aa6e8d319094c63ea8a79715c732b0fd4902 (patch)
tree04746ace2bff0a70faf03324a05d065d76a38bd2 /alacritty/src/event.rs
parentf9d83a28368f4582727160876bd2361afe61708b (diff)
downloadr-alacritty-0936aa6e8d319094c63ea8a79715c732b0fd4902.tar.gz
r-alacritty-0936aa6e8d319094c63ea8a79715c732b0fd4902.tar.bz2
r-alacritty-0936aa6e8d319094c63ea8a79715c732b0fd4902.zip
Fix unnecessary redraws due to hint highlighting
When the mouse cursor is moved by at least one cell, an update to the highlighted hints is triggered automatically. Previously this would always update the hints and redraw Alacritty regardless of the actualy change to the hint highlighting. By checking if the hint highlighting has actually changed, pointless redraws can be prevented. This is especially helpful since mouse motions often generate a lot of hint re-computations.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index a895514f..64283eb7 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1114,14 +1114,13 @@ impl<N: Notify + OnResize> Processor<N> {
}
if self.dirty || self.mouse.hint_highlight_dirty {
- self.display.update_highlighted_hints(
+ self.dirty |= self.display.update_highlighted_hints(
&terminal,
&self.config,
&self.mouse,
self.modifiers,
);
self.mouse.hint_highlight_dirty = false;
- self.dirty = true;
}
if self.dirty {