From 0bfba184f9952039c4e26a470ba195e3d7622d29 Mon Sep 17 00:00:00 2001 From: Ralf Rachinger Date: Fri, 26 Aug 2022 19:26:27 +0200 Subject: [PATCH] fix(linux/globalShortcut): disable on wayland Don't start the global shortcut thread on wayland, as its highly x11 specific and otherwise results in a segfault in libX11 --- src/platform_impl/linux/global_shortcut.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/linux/global_shortcut.rs b/src/platform_impl/linux/global_shortcut.rs index f064033214..6a9931d938 100644 --- a/src/platform_impl/linux/global_shortcut.rs +++ b/src/platform_impl/linux/global_shortcut.rs @@ -40,7 +40,7 @@ impl ShortcutManager { let (method_sender, thread_receiver) = channel::unbounded(); let (thread_sender, method_receiver) = channel::unbounded(); - std::thread::spawn(move || { + if !_window_target.p.is_wayland() { std::thread::spawn(move || { let event_loop_channel = event_loop_channel.clone(); let xlib = xlib::Xlib::open().unwrap(); unsafe { @@ -159,7 +159,7 @@ impl ShortcutManager { std::thread::sleep(std::time::Duration::from_millis(50)); } } - }); + });} ShortcutManager { shortcuts: hotkeys,