From e85f41bdf72b31f6d9224cb0d9f71986cc12a15e Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 4 Aug 2024 16:11:18 +1200 Subject: Fix display server lag This commit reverts commit 3d44c40. Calling window.title() was causing the X11 display server to go from 1% to 20% constant CPU usage when testing on Linux. --- src/window.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/window.rs b/src/window.rs index c5a4b09..b280a36 100644 --- a/src/window.rs +++ b/src/window.rs @@ -16,6 +16,7 @@ pub struct Window { render_request: RenderRequest, previous_cursor_position: Option, previous_cursor_icon: CursorIcon, + previous_title: String, } impl Window { @@ -57,6 +58,7 @@ impl Window { render_request: RenderRequest::REDRAW, previous_cursor_position: None, previous_cursor_icon: CursorIcon::Default, + previous_title: String::new(), } } @@ -66,8 +68,9 @@ impl Window { pub fn update_title(&mut self) { let title = self.controller.title(); - if title != self.window.title() { + if title != self.previous_title { self.window.set_title(&title); + self.previous_title = title; } } -- cgit v1.2.3-70-g09d2