diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-10 12:13:25 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-21 12:06:56 -0500 |
commit | a169f6e32df4012a61ec151c28b64cf26af7feb6 (patch) | |
tree | 5aae481173b9918a7bdeecd17e96c6a8ddc5a56c /gdk/x11/gdkdevice-xi.c | |
parent | c7559f57ed42dec8798f65388704fe186eb44ff3 (diff) | |
download | gtk+-a169f6e32df4012a61ec151c28b64cf26af7feb6.tar.gz |
Make GdkDevice parallel-implementable
Use the grab and ungrab vfuncs from the frontend instead of the
_gdk_windowing wrappers, and move some things around accordingly.
Again, only the X11 backend has been updated, other backends
need to be updated to match.
Diffstat (limited to 'gdk/x11/gdkdevice-xi.c')
-rw-r--r-- | gdk/x11/gdkdevice-xi.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c index 8ffd8dfa06..71b0ab5c9c 100644 --- a/gdk/x11/gdkdevice-xi.c +++ b/gdk/x11/gdkdevice-xi.c @@ -25,6 +25,7 @@ #include "gdkdeviceprivate.h" #include "gdkprivate-x11.h" #include "gdkintl.h" +#include "gdkasync.h" #include "gdkx.h" #define MAX_DEVICE_CLASSES 13 @@ -437,11 +438,18 @@ gdk_device_xi_grab (GdkDevice *device, XEventClass event_classes[MAX_DEVICE_CLASSES]; gint status, num_classes; GdkDeviceXI *device_xi; + GdkDisplay *display; device_xi = GDK_DEVICE_XI (device); + display = gdk_device_get_display (device); find_events (device, event_mask, event_classes, &num_classes); - status = XGrabDevice (GDK_WINDOW_XDISPLAY (window), +#ifdef G_ENABLE_DEBUG + if (_gdk_debug_flags & GDK_DEBUG_NOGRABS) + status = GrabSuccess; + else +#endif + status = XGrabDevice (GDK_DISPLAY_XDISPLAY (display), device_xi->xdevice, GDK_WINDOW_XID (window), owner_events, @@ -449,6 +457,8 @@ gdk_device_xi_grab (GdkDevice *device, GrabModeAsync, GrabModeAsync, time_); + _gdk_x11_display_update_grab_info (display, device, status); + return _gdk_x11_convert_grab_status (status); } @@ -456,15 +466,20 @@ static void gdk_device_xi_ungrab (GdkDevice *device, guint32 time_) { - GdkDisplay *display; GdkDeviceXI *device_xi; + GdkDisplay *display; + Display *xdisplay; + unsigned long serial; device_xi = GDK_DEVICE_XI (device); display = gdk_device_get_display (device); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + + serial = NextRequest (xdisplay); + + XUngrabDevice (xdisplay, device_xi->xdevice, time_); - XUngrabDevice (GDK_DISPLAY_XDISPLAY (device), - device_xi->xdevice, - time_); + _gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial); } static GdkWindow* |