[gtk+] Fix move-resize emulation with XI2
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Fix move-resize emulation with XI2
- Date: Sat, 10 Dec 2011 02:28:31 +0000 (UTC)
commit 89c90ed193331d2ee96f323e10aaafd4366f4b0e
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 9 21:21:09 2011 -0500
Fix move-resize emulation with XI2
https://bugzilla.gnome.org/show_bug.cgi?id=650943
gdk/x11/gdkwindow-x11.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 1ff816e..d48927f 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -4296,6 +4296,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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]