[gtk+/gdk-backend: 42/91] Add a vfunc for _gdk_windowing_window_get_next_serial
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend: 42/91] Add a vfunc for _gdk_windowing_window_get_next_serial
- Date: Sat, 18 Dec 2010 01:09:21 +0000 (UTC)
commit 868b30aa65bdec6528439517aa4c74c9ee4de4d1
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 13 14:05:59 2010 -0500
Add a vfunc for _gdk_windowing_window_get_next_serial
gdk/gdkdevice.c | 2 +-
gdk/gdkdisplay.c | 8 +++++++-
gdk/gdkdisplayprivate.h | 4 +++-
gdk/gdkwindow.c | 12 ++++++------
gdk/x11/gdkdevicemanager-core.c | 3 ++-
gdk/x11/gdkdevicemanager-xi2.c | 5 +++--
gdk/x11/gdkdisplay-x11.c | 5 +++--
7 files changed, 25 insertions(+), 14 deletions(-)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 881fef9..069fa77 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1125,7 +1125,7 @@ gdk_device_grab (GdkDevice *device,
gulong serial;
display = gdk_window_get_display (window);
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
_gdk_display_add_device_grab (display,
device,
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 3ff88cf..0fbbe20 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -677,7 +677,7 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
if (*device_serial != 0)
{
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
/* We might not actually generate the next request, so
make sure this triggers always, this may cause it to
trigger slightly too early, but this is just a hint
@@ -2409,3 +2409,9 @@ gdk_display_warp_device (GdkDisplay *display,
GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y);
}
+
+gulong
+_gdk_display_get_next_serial (GdkDisplay *display)
+{
+ return GDK_DISPLAY_GET_CLASS (display)->get_next_serial (display);
+}
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 9b1f12b..4772041 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -173,6 +173,8 @@ struct _GdkDisplayClass
void (*before_process_all_updates) (GdkDisplay *display);
void (*after_process_all_updates) (GdkDisplay *display);
+ gulong (*get_next_serial) (GdkDisplay *display);
+
/* Signals */
void (*closed) (GdkDisplay *display,
gboolean is_error);
@@ -218,7 +220,7 @@ GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display
void _gdk_display_pointer_info_foreach (GdkDisplay *display,
GdkDisplayPointerInfoForeach func,
gpointer user_data);
-
+gulong _gdk_display_get_next_serial (GdkDisplay *display);
G_END_DECLS
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index c62f057..503831e 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -5656,8 +5656,9 @@ gdk_window_hide (GdkWindow *window)
{
GdkDevice *device = d->data;
- if (_gdk_display_end_device_grab (display, device,
- _gdk_windowing_window_get_next_serial (display),
+ if (_gdk_display_end_device_grab (display,
+ device,
+ _gdk_display_get_next_serial (display),
window,
TRUE))
gdk_device_ungrab (device, GDK_CURRENT_TIME);
@@ -8708,7 +8709,7 @@ gdk_pointer_grab (GdkWindow * window,
display = gdk_window_get_display (window);
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
device_manager = gdk_display_get_device_manager (display);
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
@@ -8811,8 +8812,7 @@ gdk_keyboard_grab (GdkWindow *window,
}
display = gdk_window_get_display (window);
-
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
device_manager = gdk_display_get_device_manager (display);
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
@@ -9022,7 +9022,7 @@ do_synthesize_crossing_event (gpointer data)
return FALSE;
display = gdk_window_get_display (changed_toplevel);
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
g_hash_table_iter_init (&iter, display->pointers_info);
while (g_hash_table_iter_next (&iter, &key, &value))
diff --git a/gdk/x11/gdkdevicemanager-core.c b/gdk/x11/gdkdevicemanager-core.c
index 64f107a..7163aa2 100644
--- a/gdk/x11/gdkdevicemanager-core.c
+++ b/gdk/x11/gdkdevicemanager-core.c
@@ -23,6 +23,7 @@
#include "gdktypes.h"
#include "gdkdevicemanagerprivate.h"
+#include "gdkdisplayprivate.h"
#include "gdkeventtranslator.h"
#include "gdkdevice-core.h"
#include "gdkkeysyms.h"
@@ -391,7 +392,7 @@ get_event_window (GdkEventTranslator *translator,
GdkDeviceGrabInfo *info;
gulong serial;
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
info = _gdk_display_has_device_grab (display,
GDK_DEVICE_MANAGER_CORE (device_manager)->core_keyboard,
serial);
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index ee3461c..f692ff5 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -21,7 +21,8 @@
#include "gdkdevicemanager-xi2.h"
-#include <gdk/gdkdeviceprivate.h>
+#include "gdkdeviceprivate.h"
+#include "gdkdisplayprivate.h"
#include "gdkeventtranslator.h"
#include "gdkdevice-xi2.h"
#include "gdkkeysyms.h"
@@ -905,7 +906,7 @@ get_event_window (GdkEventTranslator *translator,
device = g_hash_table_lookup (GDK_DEVICE_MANAGER_XI2 (translator)->id_table,
GUINT_TO_POINTER (((XIDeviceEvent *) ev)->deviceid));
- serial = _gdk_windowing_window_get_next_serial (display);
+ serial = _gdk_display_get_next_serial (display);
info = _gdk_display_has_device_grab (display, device, serial);
if (info &&
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 84d0b5a..194b25f 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1486,8 +1486,8 @@ process_internal_connection (GIOChannel *gioc,
return TRUE;
}
-gulong
-_gdk_windowing_window_get_next_serial (GdkDisplay *display)
+static gulong
+gdk_x11_display_get_next_serial (GdkDisplay *display)
{
return NextRequest (GDK_DISPLAY_XDISPLAY (display));
}
@@ -2753,5 +2753,6 @@ _gdk_display_x11_class_init (GdkDisplayX11Class * class)
display_class->before_process_all_updates = _gdk_x11_display_before_process_all_updates;
display_class->after_process_all_updates = _gdk_x11_display_after_process_all_updates;
+ display_class->get_next_serial = gdk_x11_display_get_next_serial;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]