diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2019-12-31 19:53:27 +0300 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-12-31 16:53:27 +0000 |
commit | 6478ccaaa333d4493fcd813f654ca041ca20e586 (patch) | |
tree | f03d91a48584633df98cf6b82cc372163c92d690 /alacritty/src | |
parent | 3e6e8a03eeea780e28b6fc217ee495dee3342c48 (diff) | |
download | r-alacritty-6478ccaaa333d4493fcd813f654ca041ca20e586.tar.gz r-alacritty-6478ccaaa333d4493fcd813f654ca041ca20e586.tar.bz2 r-alacritty-6478ccaaa333d4493fcd813f654ca041ca20e586.zip |
Fix high startup time on wlroots compositors
Diffstat (limited to 'alacritty/src')
-rw-r--r-- | alacritty/src/display.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs index f64deaed..5e800ed5 100644 --- a/alacritty/src/display.rs +++ b/alacritty/src/display.rs @@ -21,6 +21,8 @@ use std::time::Instant; use glutin::dpi::{PhysicalPosition, PhysicalSize}; use glutin::event::ModifiersState; use glutin::event_loop::EventLoop; +#[cfg(not(any(target_os = "macos", windows)))] +use glutin::platform::unix::EventLoopWindowTargetExtUnix; use glutin::window::CursorIcon; use log::{debug, info}; use parking_lot::MutexGuard; @@ -208,7 +210,14 @@ impl Display { // We should call `clear` when window is offscreen, so when `window.show()` happens it // would be with background color instead of uninitialized surface. - window.swap_buffers(); + #[cfg(not(any(target_os = "macos", windows)))] + { + // On Wayland we can safely ignore this call, since the window isn't visible until you + // actually draw something into it. + if event_loop.is_x11() { + window.swap_buffers() + } + } window.set_visible(true); |