diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2024-08-04 16:11:18 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2024-08-04 16:11:18 +1200 |
commit | e85f41bdf72b31f6d9224cb0d9f71986cc12a15e (patch) | |
tree | dbd6dbca6f472459d675b746e089035b4ad3be96 | |
parent | 8d626d526cbf27b02896af82979a090c0b768a7d (diff) | |
download | phosphor-e85f41bdf72b31f6d9224cb0d9f71986cc12a15e.zip |
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.
-rw-r--r-- | src/window.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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<Point>, 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; } } |