diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2023-10-21 22:56:20 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-21 22:56:20 +0400 |
commit | 80d4daccc307622f8e604af4f36ac89ecccf5db7 (patch) | |
tree | d63c17a09337bb044543c2ec83302d85ffeb5cbf /alacritty/src/window_context.rs | |
parent | 6071a7bf35cfd99be8ba70f479f188b7370cda6f (diff) | |
download | r-alacritty-80d4daccc307622f8e604af4f36ac89ecccf5db7.tar.gz r-alacritty-80d4daccc307622f8e604af4f36ac89ecccf5db7.tar.bz2 r-alacritty-80d4daccc307622f8e604af4f36ac89ecccf5db7.zip |
Update winit to 0.29.2 and copypasta to 0.10.0
Fixes #7236.
Fixes #7201.
Fixes #7146.
Fixes #6848.
Fixes #3601.
Fixes #3108.
Fixes #2453.
Diffstat (limited to 'alacritty/src/window_context.rs')
-rw-r--r-- | alacritty/src/window_context.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index 301d30ad..f76faf7a 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -16,10 +16,10 @@ use glutin::display::GetGlDisplay; #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] use glutin::platform::x11::X11GlConfigExt; use log::{error, info}; +use raw_window_handle::HasRawDisplayHandle; use serde_json as json; -use winit::event::{Event as WinitEvent, Modifiers}; +use winit::event::{Event as WinitEvent, Modifiers, WindowEvent}; use winit::event_loop::{EventLoopProxy, EventLoopWindowTarget}; -use winit::window::raw_window_handle::HasRawDisplayHandle; use winit::window::WindowId; use alacritty_config::SerdeReplace; @@ -419,7 +419,8 @@ impl WindowContext { event: WinitEvent<Event>, ) { match event { - WinitEvent::AboutToWait | WinitEvent::RedrawRequested(_) => { + WinitEvent::AboutToWait + | WinitEvent::WindowEvent { event: WindowEvent::RedrawRequested, .. } => { // Skip further event handling with no staged updates. if self.event_queue.is_empty() { return; @@ -492,11 +493,12 @@ impl WindowContext { self.mouse.hint_highlight_dirty = false; } - // Request a redraw. - // - // Even though redraw requests are squashed in winit, we try not to - // request more if we haven't received a new frame request yet. - if self.dirty && !self.occluded && !matches!(event, WinitEvent::RedrawRequested(_)) { + // Don't call `request_redraw` when event is `RedrawRequested` since the `dirty` flag + // represents the current frame, but redraw is for the next frame. + if self.dirty + && !self.occluded + && !matches!(event, WinitEvent::WindowEvent { event: WindowEvent::RedrawRequested, .. }) + { self.display.window.request_redraw(); } } |