Skip to content
Snippets Groups Projects
Commit aa3e3cac authored by Olivier Fourdan's avatar Olivier Fourdan :tools:
Browse files

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: default avatarOlivier Fourdan <fourdan@xfce.org>
parent f3994308
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment