From 0936aa6e8d319094c63ea8a79715c732b0fd4902 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 9 May 2021 20:44:14 +0000 Subject: 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. --- alacritty/src/event.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'alacritty/src/event.rs') 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 Processor { } 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 { -- cgit