[Xfce4-commits] [xfce/xfwm4] 07/07: device: Use standard grabs for passive button grabs
noreply at xfce.org
noreply at xfce.org
Sun Apr 5 17:53:25 CEST 2020
This is an automated email from the git hooks/post-receive script.
o l i v i e r p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfwm4.
commit aa3e3cac7fb200f65f50bed32309c002775ed68a
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Sun Apr 5 17:41:12 2020 +0200
device: Use standard grabs for passive button grabs
Bug: 16347
XInput2 passive button grab would not fail if the button is already
grabbed by the client.
X-AIR-Edit is such a client which issues a button grab on its own
window, meaning that with XI2 button it would not react to button events
anymore.
Revert to the standard grab button for the passive grabs so that such
apps can still work with xfwm4.
Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
src/device.c | 51 ++++++---------------------------------------------
1 file changed, 6 insertions(+), 45 deletions(-)
diff --git a/src/device.c b/src/device.c
index 47403b1..796be92 100644
--- a/src/device.c
+++ b/src/device.c
@@ -402,59 +402,20 @@ xfwm_device_grab_button (XfwmDevices *devices, Display *display,
gint grab_mode, gint paired_device_mode,
Window confine_to, Cursor cursor)
{
- gboolean result;
- Status status;
-#ifdef HAVE_XI2
- XIGrabModifiers xi2_modifiers;
- XIEventMask xievent_mask;
-#endif
+ gboolean status;
-#ifdef HAVE_XI2
- if (devices->xi2_available)
- {
- xi2_modifiers.modifiers = xi2_modifier_mask (modifiers);
- xi2_modifiers.status = 0;
+ status = XGrabButton (display, button, modifiers, grab_window,
+ owner_events, event_mask, grab_mode, paired_device_mode,
+ confine_to, cursor);
- xfwm_device_fill_xi2_event_mask (&xievent_mask, event_mask);
- status = XIGrabButton (display, devices->pointer.xi2_device, button, grab_window,
- cursor, grab_mode, paired_device_mode, owner_events,
- &xievent_mask, 1, &xi2_modifiers);
- g_free (xievent_mask.mask);
- result = (status == XIGrabSuccess);
- }
- else
-#endif
- {
- status = XGrabButton (display, button, modifiers, grab_window,
- owner_events, event_mask, grab_mode, paired_device_mode,
- confine_to, cursor);
- result = (status == GrabSuccess);
- }
- return result;
+ return status;
}
void
xfwm_device_ungrab_button (XfwmDevices *devices, Display *display,
guint button, guint modifiers, Window grab_window)
{
-#ifdef HAVE_XI2
- XIGrabModifiers xi2_modifiers;
-#endif
-
-#ifdef HAVE_XI2
- if (devices->xi2_available)
- {
- xi2_modifiers.modifiers = xi2_modifier_mask (modifiers);
- xi2_modifiers.status = 0;
-
- XIUngrabButton (display, devices->pointer.xi2_device, button,
- grab_window, 1, &xi2_modifiers);
- }
- else
-#endif
- {
- XUngrabButton (display, button, modifiers, grab_window);
- }
+ XUngrabButton (display, button, modifiers, grab_window);
}
gboolean
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list