Commit e3005ea4 authored by Matthias Clasen's avatar Matthias Clasen

Fix move-resize emulation with XI2

https://bugzilla.gnome.org/show_bug.cgi?id=650943
parent 08473895
......@@ -4293,6 +4293,33 @@ _gdk_x11_moveresize_handle_event (XEvent *event)
if (event->xbutton.button == mv_resize->moveresize_button)
finish_drag (mv_resize);
break;
#ifdef HAVE_XGENERICEVENTS
case GenericEvent:
{
/* we just assume this is an XI2 event */
XIEvent *ev = (XIEvent *) event->xcookie.data;
XIDeviceEvent *xev = (XIDeviceEvent *)ev;
gint state;
switch (ev->evtype)
{
case XI_Motion:
update_pos (mv_resize, xev->root_x, xev->root_y);
state = _gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group);
if ((state & button_mask) == 0)
finish_drag (mv_resize);
break;
case XI_ButtonRelease:
update_pos (mv_resize, xev->root_x, xev->root_y);
if (xev->detail == mv_resize->moveresize_button)
finish_drag (mv_resize);
break;
}
}
break;
#endif
}
return TRUE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment