diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-12-30 19:25:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-30 19:25:04 +0300 |
commit | 2bd26fbeb0c51cd8a98ae31d58ea105d1274387a (patch) | |
tree | 60472cba6bae5909fe7278baea2446cb8224ad15 /alacritty/src/window_context.rs | |
parent | b77b9b3bcdc457e4b2557e55f9983ce36e40a903 (diff) | |
download | r-alacritty-2bd26fbeb0c51cd8a98ae31d58ea105d1274387a.tar.gz r-alacritty-2bd26fbeb0c51cd8a98ae31d58ea105d1274387a.tar.bz2 r-alacritty-2bd26fbeb0c51cd8a98ae31d58ea105d1274387a.zip |
User timer based rendering instead of vsync
Fixes #824.
Diffstat (limited to 'alacritty/src/window_context.rs')
-rw-r--r-- | alacritty/src/window_context.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index 833586ea..79bc918b 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -7,7 +7,6 @@ use std::mem; #[cfg(not(windows))] use std::os::unix::io::{AsRawFd, RawFd}; use std::rc::Rc; -#[cfg(not(any(target_os = "macos", windows)))] use std::sync::atomic::Ordering; use std::sync::Arc; @@ -478,9 +477,8 @@ impl WindowContext { self.mouse.hint_highlight_dirty = false; } - // Skip rendering on Wayland until we get frame event from compositor. - #[cfg(not(any(target_os = "macos", windows)))] - if self.display.is_wayland && !self.display.window.should_draw.load(Ordering::Relaxed) { + // Skip rendering until we get a new frame. + if !self.display.window.has_frame.load(Ordering::Relaxed) { return; } @@ -495,8 +493,14 @@ impl WindowContext { self.display.window.request_redraw(); } - // Redraw screen. - self.display.draw(terminal, &self.message_buffer, &self.config, &self.search_state); + // Redraw the window. + self.display.draw( + terminal, + scheduler, + &self.message_buffer, + &self.config, + &self.search_state, + ); } } |