summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-10-12 22:13:38 +0000
committerGitHub <noreply@github.com>2020-10-12 22:13:38 +0000
commitb2629192ab9926b095d0abe85fedbc353e5e348c (patch)
tree549da42a34d56143ebab4f177efd79caf20fb507
parent721f789b5f98ab5c47e6e817c3c2228636ca0a1a (diff)
downloadalacritty-b2629192ab9926b095d0abe85fedbc353e5e348c.tar.gz
alacritty-b2629192ab9926b095d0abe85fedbc353e5e348c.zip
Fix incorrect X11 feature check
See https://github.com/alacritty/alacritty/commit/721f789b5f98ab5c47e6e817c3c2228636ca0a1a#r43183826.
-rw-r--r--alacritty/src/display.rs2
-rw-r--r--alacritty/src/event.rs2
-rw-r--r--alacritty/src/window.rs17
3 files changed, 10 insertions, 11 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs
index a4cf5cc5..0c5948fe 100644
--- a/alacritty/src/display.rs
+++ b/alacritty/src/display.rs
@@ -590,7 +590,7 @@ impl Display {
self.window.swap_buffers();
- #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
+ #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
if self.is_x11 {
// On X11 `swap_buffers` does not block for vsync. However the next OpenGl command
// will block to synchronize (this is `glClear` in Alacritty), which causes a
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index d16ffde6..5da2a939 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -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, not(feature = "wayland")))]
+ #[cfg(any(not(feature = "wayland"), target_os = "macos", windows))]
fn event_queue_empty(&mut self) -> bool {
self.event_queue.is_empty()
}
diff --git a/alacritty/src/window.rs b/alacritty/src/window.rs
index e69046de..74014a07 100644
--- a/alacritty/src/window.rs
+++ b/alacritty/src/window.rs
@@ -166,7 +166,7 @@ impl Window {
// Check if we're running Wayland to disable vsync.
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
let is_wayland = event_loop.is_wayland();
- #[cfg(any(target_os = "macos", windows, not(feature = "wayland")))]
+ #[cfg(any(not(feature = "wayland"), target_os = "macos", windows))]
let is_wayland = false;
let windowed_context =
@@ -182,9 +182,6 @@ impl Window {
// Set OpenGL symbol loader. This call MUST be after window.make_current on windows.
gl::load_with(|symbol| windowed_context.get_proc_address(symbol) as *const _);
- #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
- let mut wayland_surface = None;
-
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
if !is_wayland {
// On X11, embed the window inside another if the parent ID has been set.
@@ -194,7 +191,7 @@ impl Window {
}
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
- if is_wayland {
+ let wayland_surface = if is_wayland {
// Apply client side decorations theme.
let theme = AlacrittyWaylandTheme::new(&config.colors);
windowed_context.window().set_wayland_theme(theme);
@@ -202,8 +199,10 @@ impl Window {
// Attach surface to Alacritty's internal wayland queue to handle frame callbacks.
let surface = windowed_context.window().wayland_surface().unwrap();
let proxy: Proxy<WlSurface> = unsafe { Proxy::from_c_ptr(surface as _) };
- wayland_surface = Some(proxy.attach(wayland_event_queue.as_ref().unwrap().token()));
- }
+ Some(proxy.attach(wayland_event_queue.as_ref().unwrap().token()))
+ } else {
+ None
+ };
let dpr = windowed_context.window().scale_factor();
@@ -340,7 +339,7 @@ impl Window {
self.window().request_user_attention(RequestUserAttentionType::Critical);
}
- #[cfg(any(windows, not(feature = "x11")))]
+ #[cfg(any(not(feature = "x11"), windows))]
pub fn set_urgent(&self, _is_urgent: bool) {}
pub fn set_outer_position(&self, pos: PhysicalPosition<i32>) {
@@ -352,7 +351,7 @@ impl Window {
self.window().xlib_window().map(|xlib_window| xlib_window as usize)
}
- #[cfg(any(target_os = "macos", windows, not(feature = "x11")))]
+ #[cfg(any(not(feature = "x11"), target_os = "macos", windows))]
pub fn x11_window_id(&self) -> Option<usize> {
None
}