From efdece5daacfe1f8d3d74a8ef441aab7e8355ac9 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Thu, 21 Oct 2021 11:12:27 +0200 Subject: [PATCH] X11: Only fetch virtual keyboard events from master devices We must not report virtual keyboard events for keys that were grabbed by other applications (XGrabKey, etc.). Since grabs only affect master devices, we must consume virtual events from master devices only. --- src/platform_impl/linux/x11/mod.rs | 4 +--- src/platform_impl/linux/x11/window.rs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 417757d9be..6aa493e215 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -626,9 +626,7 @@ impl Device { | ffi::XI_RawButtonPressMask | ffi::XI_RawButtonReleaseMask | ffi::XI_RawKeyPressMask - | ffi::XI_RawKeyReleaseMask - | ffi::XI_KeyPressMask - | ffi::XI_KeyReleaseMask; + | ffi::XI_RawKeyReleaseMask; // The request buffer is flushed when we poll for events wt.xconn .select_xinput_events(wt.root, info.deviceid, mask) diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index fb5d007d6d..494263d56e 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -407,8 +407,8 @@ impl UnownedWindow { let mask = ffi::XI_MotionMask | ffi::XI_ButtonPressMask | ffi::XI_ButtonReleaseMask - //| ffi::XI_KeyPressMask - //| ffi::XI_KeyReleaseMask + | ffi::XI_KeyPressMask + | ffi::XI_KeyReleaseMask | ffi::XI_EnterMask | ffi::XI_LeaveMask | ffi::XI_FocusInMask