diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-10-12 12:22:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 12:22:36 +0300 |
commit | 721f789b5f98ab5c47e6e817c3c2228636ca0a1a (patch) | |
tree | 31d9a149fbcf36c9a824856d1da103c06f67f16c /alacritty/src/event.rs | |
parent | 56e0f5bb05cab709f815ef9cce027b379ce964b8 (diff) | |
download | r-alacritty-721f789b5f98ab5c47e6e817c3c2228636ca0a1a.tar.gz r-alacritty-721f789b5f98ab5c47e6e817c3c2228636ca0a1a.tar.bz2 r-alacritty-721f789b5f98ab5c47e6e817c3c2228636ca0a1a.zip |
Make use of glutin wayland/x11 features
This should allow users that are not using Wayland/X11
to reduce the resulted binary size and compilation times.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r-- | alacritty/src/event.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index a4437f6f..d16ffde6 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -19,7 +19,7 @@ use glutin::dpi::PhysicalSize; use glutin::event::{ElementState, Event as GlutinEvent, ModifiersState, MouseButton, WindowEvent}; use glutin::event_loop::{ControlFlow, EventLoop, EventLoopProxy, EventLoopWindowTarget}; use glutin::platform::desktop::EventLoopExtDesktop; -#[cfg(not(any(target_os = "macos", windows)))] +#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] use glutin::platform::unix::EventLoopWindowTargetExtUnix; use log::info; use serde_json as json; @@ -749,7 +749,7 @@ impl<N: Notify + OnResize> Processor<N> { /// Return `true` if `event_queue` is empty, `false` otherwise. #[inline] - #[cfg(not(any(target_os = "macos", windows)))] + #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] fn event_queue_empty(&mut self) -> bool { let wayland_event_queue = match self.display.wayland_event_queue.as_mut() { Some(wayland_event_queue) => wayland_event_queue, @@ -767,7 +767,7 @@ impl<N: Notify + OnResize> Processor<N> { /// Return `true` if `event_queue` is empty, `false` otherwise. #[inline] - #[cfg(any(target_os = "macos", windows))] + #[cfg(any(target_os = "macos", windows, not(feature = "wayland")))] fn event_queue_empty(&mut self) -> bool { self.event_queue.is_empty() } @@ -863,7 +863,7 @@ impl<N: Notify + OnResize> Processor<N> { // Skip rendering on Wayland until we get frame event from compositor. #[cfg(not(any(target_os = "macos", windows)))] - if event_loop.is_wayland() && !self.display.window.should_draw.load(Ordering::Relaxed) { + if !self.display.is_x11 && !self.display.window.should_draw.load(Ordering::Relaxed) { return; } @@ -1114,7 +1114,7 @@ impl<N: Notify + OnResize> Processor<N> { processor.ctx.window.set_title(&config.ui_config.window.title); } - #[cfg(not(any(target_os = "macos", windows)))] + #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] if processor.ctx.event_loop.is_wayland() { processor.ctx.window.set_wayland_theme(&config.colors); } |