[gtk+/gdk-backend] Make GdkDevice parallel-implementable
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend] Make GdkDevice parallel-implementable
- Date: Fri, 10 Dec 2010 17:15:00 +0000 (UTC)
commit 7206f0cbd72b84589af985c9495c9db144127196
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 10 12:13:25 2010 -0500
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.
gdk/Makefile.am | 1 -
gdk/gdk.h | 1 -
gdk/gdkdevice.c | 84 +++++++++++++++++++++++++++++++++++++--------
gdk/gdkdevice.h | 4 ++
gdk/gdkdeviceprivate.h | 3 +-
gdk/gdkdisplay.c | 34 ------------------
gdk/gdkinput.h | 60 --------------------------------
gdk/gdkinternals.h | 10 -----
gdk/gdkwindow.c | 30 ++++++++---------
gdk/x11/gdkdevice-core.c | 15 ++++++++-
gdk/x11/gdkdevice-core.h | 2 +-
gdk/x11/gdkdevice-xi.c | 26 +++++++++++---
gdk/x11/gdkdevice-xi.h | 3 +-
gdk/x11/gdkdevice-xi2.c | 19 ++++++++--
gdk/x11/gdkdevice-xi2.h | 3 +-
gdk/x11/gdkdisplay-x11.c | 58 +++++++++++---------------------
gdk/x11/gdkinput.c | 2 +-
gdk/x11/gdkmain-x11.c | 47 -------------------------
gdk/x11/gdkprivate-x11.h | 9 +++++
19 files changed, 173 insertions(+), 238 deletions(-)
---
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 221e1eb..7c5eddb 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -72,7 +72,6 @@ gdk_public_h_sources = \
gdkdisplaymanager.h \
gdkdnd.h \
gdkevents.h \
- gdkinput.h \
gdkkeys.h \
gdkkeysyms.h \
gdkkeysyms-compat.h \
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 87a7160..938961e 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -41,7 +41,6 @@
#include <gdk/gdkdnd.h>
#include <gdk/gdkenumtypes.h>
#include <gdk/gdkevents.h>
-#include <gdk/gdkinput.h>
#include <gdk/gdkkeys.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkmain.h>
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 4e9b3d2..16f4b82 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -21,9 +21,9 @@
#include "gdkdevice.h"
+#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
#include "gdkintl.h"
-#include "gdkinternals.h"
typedef struct _GdkDeviceKey GdkDeviceKey;
@@ -590,7 +590,7 @@ gdk_device_set_mode (GdkDevice *device,
g_object_notify (G_OBJECT (device), "input-mode");
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER)
- _gdk_input_check_extension_events (device);
+ GDK_DEVICE_GET_CLASS (device)->check_extension_events (device);
return TRUE;
}
@@ -1059,8 +1059,8 @@ gdk_device_grab (GdkDevice *device,
GdkGrabStatus res;
GdkWindow *native;
- g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
- g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+ g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_SUCCESS);
+ g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_SUCCESS);
if (_gdk_native_windows)
native = window;
@@ -1072,21 +1072,23 @@ gdk_device_grab (GdkDevice *device,
native = gdk_offscreen_window_get_embedder (native);
if (native == NULL ||
- (!_gdk_window_has_impl (native) &&
- !gdk_window_is_viewable (native)))
- return GDK_GRAB_NOT_VIEWABLE;
+ (!_gdk_window_has_impl (native) &&
+ !gdk_window_is_viewable (native)))
+ return GDK_GRAB_NOT_VIEWABLE;
native = gdk_window_get_toplevel (native);
}
- res = _gdk_windowing_device_grab (device,
- window,
- native,
- owner_events,
- get_native_grab_event_mask (event_mask),
- NULL,
- cursor,
- time_);
+ if (native == NULL || GDK_WINDOW_DESTROYED (native))
+ return GDK_GRAB_NOT_VIEWABLE;
+
+ res = GDK_DEVICE_GET_CLASS (device)->grab (device,
+ native,
+ owner_events,
+ get_native_grab_event_mask (event_mask),
+ NULL,
+ cursor,
+ time_);
if (res == GDK_GRAB_SUCCESS)
{
@@ -1111,6 +1113,24 @@ gdk_device_grab (GdkDevice *device,
return res;
}
+/**
+ * gdk_device_ungrab:
+ * @device: a #GdkDevice
+ * @time_: a timestap (e.g. %GDK_CURRENT_TIME).
+ *
+ * Release any grab on @device.
+ *
+ * Since: 3.0
+ */
+void
+gdk_device_ungrab (GdkDevice *device,
+ guint32 time_)
+{
+ g_return_if_fail (GDK_IS_DEVICE (device));
+
+ GDK_DEVICE_GET_CLASS (device)->ungrab (device, time_);
+}
+
/* Private API */
void
_gdk_device_reset_axes (GdkDevice *device)
@@ -1410,3 +1430,37 @@ _gdk_device_translate_axis (GdkDevice *device,
return TRUE;
}
+
+/**
+ * gdk_device_get_core_pointer:
+ *
+ * Returns the core pointer device for the default display.
+ *
+ * Return value: (transfer none): the core pointer device; this is owned
+ * by the display and should not be freed.
+ *
+ * Deprecated: 3.0: Use gdk_device_manager_get_client_pointer() instead, or
+ * gdk_event_get_device() if a #GdkEvent with pointer device
+ * information is available.
+ **/
+GdkDevice *
+gdk_device_get_core_pointer (void)
+{
+ return gdk_display_get_core_pointer (gdk_display_get_default ());
+}
+
+/**
+ * gdk_devices_list:
+ *
+ * Returns the list of available input devices for the default display.
+ * The list is statically allocated and should not be freed.
+ *
+ * Return value: (transfer none) (element-type GdkDevice): a list of #GdkDevice
+ *
+ * Deprecated: 3.0: Use gdk_device_manager_list_devices() instead.
+ **/
+GList *
+gdk_devices_list (void)
+{
+ return gdk_display_list_devices (gdk_display_get_default ());
+}
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 27375f7..745cfaa 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -241,6 +241,10 @@ gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events);
+#ifndef GTK_DISABLE_DEPRECATED
+GdkDevice *gdk_device_get_core_pointer (void);
+GList *gdk_devices_list (void);
+#endif
G_END_DECLS
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index d878ae6..7714339 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -82,6 +82,7 @@ struct _GdkDeviceClass
void (* select_window_events) (GdkDevice *device,
GdkWindow *window,
GdkEventMask event_mask);
+ void (* check_extension_events) (GdkDevice *device);
};
void _gdk_device_set_associated_device (GdkDevice *device,
@@ -123,8 +124,6 @@ gboolean _gdk_device_translate_axis (GdkDevice *device,
GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
gint n_events);
-void _gdk_input_check_extension_events (GdkDevice *device);
-
G_END_DECLS
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 629e394..545b1a9 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -652,24 +652,6 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
}
/**
- * gdk_device_get_core_pointer:
- *
- * Returns the core pointer device for the default display.
- *
- * Return value: (transfer none): the core pointer device; this is owned
- * by the display and should not be freed.
- *
- * Deprecated: 3.0: Use gdk_device_manager_get_client_pointer() instead, or
- * gdk_event_get_device() if a #GdkEvent with pointer device
- * information is available.
- **/
-GdkDevice *
-gdk_device_get_core_pointer (void)
-{
- return gdk_display_get_core_pointer (gdk_display_get_default ());
-}
-
-/**
* gdk_display_get_core_pointer:
* @display: a #GdkDisplay
*
@@ -2176,22 +2158,6 @@ gdk_display_list_devices (GdkDisplay *display)
}
/**
- * gdk_devices_list:
- *
- * Returns the list of available input devices for the default display.
- * The list is statically allocated and should not be freed.
- *
- * Return value: (transfer none) (element-type GdkDevice): a list of #GdkDevice
- *
- * Deprecated: 3.0: Use gdk_device_manager_list_devices() instead.
- **/
-GList *
-gdk_devices_list (void)
-{
- return gdk_display_list_devices (gdk_display_get_default ());
-}
-
-/**
* gdk_event_send_client_message_for_display:
* @display: the #GdkDisplay for the window where the message is to be sent.
* @event: the #GdkEvent to send, which should be a #GdkEventClient.
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 5bbba5a..03da94b 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -30,8 +30,6 @@
#define __GDK_INTERNALS_H__
#include <gio/gio.h>
-#include <gdk/gdktypes.h>
-#include <gdk/gdkwindow.h>
#include <gdk/gdkwindowimpl.h>
#include <gdk/gdkprivate.h>
@@ -628,14 +626,6 @@ GdkWindow* _gdk_windowing_window_at_device_position (GdkDisplay *display,
gint *win_y,
GdkModifierType *mask,
gboolean get_toplevel);
-GdkGrabStatus _gdk_windowing_device_grab (GdkDevice *device,
- GdkWindow *window,
- GdkWindow *native,
- gboolean owner_events,
- GdkEventMask event_mask,
- GdkWindow *confine_to,
- GdkCursor *cursor,
- guint32 time);
void _gdk_windowing_got_event (GdkDisplay *display,
GList *event_link,
GdkEvent *event,
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index b624101..398a47a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8756,14 +8756,13 @@ gdk_pointer_grab (GdkWindow * window,
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
continue;
- res = _gdk_windowing_device_grab (device,
- window,
- native,
- owner_events,
- get_native_grab_event_mask (event_mask),
- confine_to,
- cursor,
- time);
+ res = GDK_DEVICE_GET_CLASS (device)->grab (device,
+ native,
+ owner_events,
+ get_native_grab_event_mask (event_mask),
+ confine_to,
+ cursor,
+ time);
if (res == GDK_GRAB_SUCCESS)
_gdk_display_add_device_grab (display,
@@ -8861,14 +8860,13 @@ gdk_keyboard_grab (GdkWindow *window,
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
continue;
- res = _gdk_windowing_device_grab (device,
- window,
- native,
- owner_events,
- GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,
- NULL,
- NULL,
- time);
+ res = GDK_DEVICE_GET_CLASS (device)->grab (device,
+ native,
+ owner_events,
+ GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK,
+ NULL,
+ NULL,
+ time);
if (res == GDK_GRAB_SUCCESS)
_gdk_display_add_device_grab (display,
diff --git a/gdk/x11/gdkdevice-core.c b/gdk/x11/gdkdevice-core.c
index 008e339..339fe4e 100644
--- a/gdk/x11/gdkdevice-core.c
+++ b/gdk/x11/gdkdevice-core.c
@@ -24,6 +24,7 @@
#include "gdkinternals.h"
#include "gdkwindow.h"
#include "gdkprivate-x11.h"
+#include "gdkasync.h"
#include "gdkx.h"
static gboolean gdk_device_core_get_history (GdkDevice *device,
@@ -87,6 +88,7 @@ gdk_device_core_class_init (GdkDeviceCoreClass *klass)
device_class->ungrab = gdk_device_core_ungrab;
device_class->window_at_position = gdk_device_core_window_at_position;
device_class->select_window_events = gdk_device_core_select_window_events;
+ device_class->check_extension_events = _gdk_x11_device_check_extension_events;
}
static void
@@ -296,7 +298,7 @@ gdk_device_core_grab (GdkDevice *device,
{
GdkDisplay *display;
Window xwindow, xconfine_to;
- int status;
+ gint status;
display = gdk_device_get_display (device);
@@ -310,6 +312,11 @@ gdk_device_core_grab (GdkDevice *device,
else
xconfine_to = GDK_WINDOW_XID (confine_to);
+#ifdef G_ENABLE_DEBUG
+ if (_gdk_debug_flags & GDK_DEBUG_NOGRABS)
+ status = GrabSuccess;
+ else
+#endif
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
{
/* Device is a keyboard */
@@ -357,6 +364,8 @@ gdk_device_core_grab (GdkDevice *device,
time_);
}
+ _gdk_x11_display_update_grab_info (display, device, status);
+
return _gdk_x11_convert_grab_status (status);
}
@@ -365,13 +374,17 @@ gdk_device_core_ungrab (GdkDevice *device,
guint32 time_)
{
GdkDisplay *display;
+ gulong serial;
display = gdk_device_get_display (device);
+ serial = NextRequest (GDK_DISPLAY_XDISPLAY (display));
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
XUngrabKeyboard (GDK_DISPLAY_XDISPLAY (display), time_);
else
XUngrabPointer (GDK_DISPLAY_XDISPLAY (display), time_);
+
+ _gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial);
}
static GdkWindow *
diff --git a/gdk/x11/gdkdevice-core.h b/gdk/x11/gdkdevice-core.h
index 04424b5..af425da 100644
--- a/gdk/x11/gdkdevice-core.h
+++ b/gdk/x11/gdkdevice-core.h
@@ -20,7 +20,7 @@
#ifndef __GDK_DEVICE_CORE_H__
#define __GDK_DEVICE_CORE_H__
-#include <gdk/gdkdeviceprivate.h>
+#include "gdkdeviceprivate.h"
G_BEGIN_DECLS
diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c
index 8ffd8df..51e4a30 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
@@ -126,6 +127,7 @@ gdk_device_xi_class_init (GdkDeviceXIClass *klass)
device_class->ungrab = gdk_device_xi_ungrab;
device_class->window_at_position = gdk_device_xi_window_at_position;
device_class->select_window_events = gdk_device_xi_select_window_events;
+ device_class->check_extension_events = _gdk_x11_device_check_extension_events;
g_object_class_install_property (object_class,
PROP_DEVICE_ID,
@@ -437,11 +439,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 +458,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 +467,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*
diff --git a/gdk/x11/gdkdevice-xi.h b/gdk/x11/gdkdevice-xi.h
index 55f33d3..36fab89 100644
--- a/gdk/x11/gdkdevice-xi.h
+++ b/gdk/x11/gdkdevice-xi.h
@@ -20,7 +20,8 @@
#ifndef __GDK_DEVICE_XI_H__
#define __GDK_DEVICE_XI_H__
-#include <gdk/gdkdeviceprivate.h>
+#include "gdkdeviceprivate.h"
+
#include <X11/extensions/XInput.h>
G_BEGIN_DECLS
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 7c91cd3..9c33b3a 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -22,6 +22,7 @@
#include "gdkdevice-xi2.h"
#include "gdkintl.h"
+#include "gdkasync.h"
#include "gdkx.h"
#include <X11/extensions/XInput2.h>
@@ -105,6 +106,7 @@ gdk_device_xi2_class_init (GdkDeviceXI2Class *klass)
device_class->ungrab = gdk_device_xi2_ungrab;
device_class->window_at_position = gdk_device_xi2_window_at_position;
device_class->select_window_events = gdk_device_xi2_select_window_events;
+ device_class->check_extension_events = _gdk_x11_device_check_extension_events;
g_object_class_install_property (object_class,
PROP_DEVICE_ID,
@@ -364,7 +366,7 @@ gdk_device_xi2_grab (GdkDevice *device,
XIEventMask mask;
Window xwindow;
Cursor xcursor;
- int status;
+ gint status;
priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
@@ -384,6 +386,11 @@ gdk_device_xi2_grab (GdkDevice *device,
mask.deviceid = priv->device_id;
mask.mask = gdk_device_xi2_translate_event_mask (event_mask, &mask.mask_len);
+#ifdef G_ENABLE_DEBUG
+ if (_gdk_debug_flags & GDK_DEBUG_NOGRABS)
+ status = GrabSuccess;
+ else
+#endif
status = XIGrabDevice (GDK_DISPLAY_XDISPLAY (display),
priv->device_id,
xwindow,
@@ -395,6 +402,8 @@ gdk_device_xi2_grab (GdkDevice *device,
g_free (mask.mask);
+ _gdk_x11_display_update_grab_info (display, device, status);
+
return _gdk_x11_convert_grab_status (status);
}
@@ -404,13 +413,15 @@ gdk_device_xi2_ungrab (GdkDevice *device,
{
GdkDeviceXI2Private *priv;
GdkDisplay *display;
+ gulong serial;
priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
+ serial = NextRequest (GDK_DISPLAY_XDISPLAY (display));
- XIUngrabDevice (GDK_DISPLAY_XDISPLAY (display),
- priv->device_id,
- time_);
+ XIUngrabDevice (GDK_DISPLAY_XDISPLAY (display), priv->device_id, time_);
+
+ _gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial);
}
static GdkWindow *
diff --git a/gdk/x11/gdkdevice-xi2.h b/gdk/x11/gdkdevice-xi2.h
index 2fa3064..f30ebb7 100644
--- a/gdk/x11/gdkdevice-xi2.h
+++ b/gdk/x11/gdkdevice-xi2.h
@@ -20,7 +20,8 @@
#ifndef __GDK_DEVICE_XI2_H__
#define __GDK_DEVICE_XI2_H__
-#include <gdk/gdkdeviceprivate.h>
+#include "gdkdeviceprivate.h"
+
#include <X11/extensions/XInput2.h>
G_BEGIN_DECLS
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 5084641..b750a32 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1575,60 +1575,42 @@ struct XPointerUngrabInfo {
guint32 time;
};
-static void
-device_ungrab_callback (GdkDisplay *display,
- gpointer data,
- gulong serial)
-{
- GdkDevice *device = data;
-
- _gdk_display_device_grab_update (display, device, serial);
-}
-
-
#define XSERVER_TIME_IS_LATER(time1, time2) \
( (( time1 > time2 ) && ( time1 - time2 < ((guint32)-1)/2 )) || \
(( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \
)
-/**
- * gdk_device_ungrab:
- * @device: a #GdkDevice
- * @time_: a timestap (e.g. %GDK_CURRENT_TIME).
- *
- * Release any grab on @device.
- *
- * Since: 3.0
- */
void
-gdk_device_ungrab (GdkDevice *device,
- guint32 time_)
+_gdk_x11_display_update_grab_info (GdkDisplay *display,
+ GdkDevice *device,
+ gint status)
+{
+ if (status == GrabSuccess)
+ _gdk_x11_roundtrip_async (display,
+ (GdkRoundTripCallback)_gdk_display_device_grab_update,
+ device);
+}
+
+void
+_gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
+ GdkDevice *device,
+ guint32 time,
+ gulong serial)
{
- GdkDisplay *display;
- Display *xdisplay;
GdkDeviceGrabInfo *grab;
- unsigned long serial;
-
- g_return_if_fail (GDK_IS_DEVICE (device));
-
- display = gdk_device_get_display (device);
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
- serial = NextRequest (xdisplay);
-
- GDK_DEVICE_GET_CLASS (device)->ungrab (device, time_);
- XFlush (xdisplay);
+ XFlush (GDK_DISPLAY_XDISPLAY (display));
grab = _gdk_display_get_last_device_grab (display, device);
if (grab &&
- (time_ == GDK_CURRENT_TIME ||
+ (time == GDK_CURRENT_TIME ||
grab->time == GDK_CURRENT_TIME ||
- !XSERVER_TIME_IS_LATER (grab->time, time_)))
+ !XSERVER_TIME_IS_LATER (grab->time, time)))
{
grab->serial_end = serial;
_gdk_x11_roundtrip_async (display,
- device_ungrab_callback,
- device);
+ (GdkRoundTripCallback)_gdk_display_device_grab_update,
+ device);
}
}
diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c
index aba194d..3c55be7 100644
--- a/gdk/x11/gdkinput.c
+++ b/gdk/x11/gdkinput.c
@@ -195,7 +195,7 @@ _gdk_input_window_destroy (GdkWindow *window)
}
void
-_gdk_input_check_extension_events (GdkDevice *device)
+_gdk_x11_device_check_extension_events (GdkDevice *device)
{
GdkDisplayX11 *display_impl;
GdkInputWindow *input_window;
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 3fb4181..5890335 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -129,53 +129,6 @@ _gdk_x11_convert_grab_status (gint status)
return 0;
}
-static void
-has_pointer_grab_callback (GdkDisplay *display,
- gpointer data,
- gulong serial)
-{
- GdkDevice *device = data;
-
- _gdk_display_device_grab_update (display, device, serial);
-}
-
-GdkGrabStatus
-_gdk_windowing_device_grab (GdkDevice *device,
- GdkWindow *window,
- GdkWindow *native,
- gboolean owner_events,
- GdkEventMask event_mask,
- GdkWindow *confine_to,
- GdkCursor *cursor,
- guint32 time)
-{
- GdkDisplay *display;
- GdkGrabStatus status = GDK_GRAB_SUCCESS;
-
- if (!window || GDK_WINDOW_DESTROYED (window))
- return GDK_GRAB_NOT_VIEWABLE;
-
- display = gdk_device_get_display (device);
-
-#ifdef G_ENABLE_DEBUG
- if (_gdk_debug_flags & GDK_DEBUG_NOGRABS)
- status = GrabSuccess;
- else
-#endif
- status = GDK_DEVICE_GET_CLASS (device)->grab (device,
- native,
- owner_events,
- event_mask,
- confine_to,
- cursor,
- time);
- if (status == GDK_GRAB_SUCCESS)
- _gdk_x11_roundtrip_async (display,
- has_pointer_grab_callback,
- device);
- return status;
-}
-
/**
* _gdk_xgrab_check_unmap:
* @window: a #GdkWindow
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index f3867ab..682cc10 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -139,6 +139,15 @@ void _gdk_xgrab_check_destroy (GdkWindow *window);
gboolean _gdk_x11_display_is_root_window (GdkDisplay *display,
Window xroot_window);
+void _gdk_x11_display_update_grab_info (GdkDisplay *display,
+ GdkDevice *device,
+ gint status);
+void _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
+ GdkDevice *device,
+ guint32 time,
+ gulong serial);
+void _gdk_x11_device_check_extension_events (GdkDevice *device);
+
void _gdk_x11_precache_atoms (GdkDisplay *display,
const gchar * const *atom_names,
gint n_atoms);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]