[gtk+] Do not use deprecated gdk_display_get_core_pointer()



commit 9c3d1080d60171f21e8d150c16bc58024bdb9e29
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Sep 13 02:50:45 2010 +0200

    Do not use deprecated gdk_display_get_core_pointer()
    
    Use gdk_device_manager_get_client_pointer() instead

 gdk/gdkevents.c              |    4 +++-
 gdk/quartz/GdkQuartzWindow.c |    4 +++-
 gdk/quartz/gdkdnd-quartz.c   |    7 +++++--
 gdk/win32/gdkdnd-win32.c     |   19 ++++++++++++++-----
 gdk/x11/gdkdnd-x11.c         |   10 +++++++---
 5 files changed, 32 insertions(+), 12 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 00557fd..053e6d5 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -1033,13 +1033,15 @@ gdk_event_get_device (const GdkEvent *event)
       {
         GdkDisplay *display;
         GdkDevice *core_pointer;
+        GdkDeviceManager *device_manager;
 
         g_warning ("Event with type %d not holding a GdkDevice. "
                    "It is most likely synthesized outside Gdk/GTK+\n",
                    event->type);
 
         display = gdk_drawable_get_display (event->any.window);
-        core_pointer = gdk_display_get_core_pointer (display);
+        device_manager = gdk_display_get_device_manager (display);
+        core_pointer = gdk_device_manager_get_client_pointer (device_manager);
 
         if (event->type == GDK_KEY_PRESS ||
             event->type == GDK_KEY_RELEASE)
diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c
index f1ac22b..d127690 100644
--- a/gdk/quartz/GdkQuartzWindow.c
+++ b/gdk/quartz/GdkQuartzWindow.c
@@ -454,6 +454,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
 
 - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
 {
+  GdkDeviceManager device_manager;
   GdkEvent *event;
   GdkWindow *window;
 
@@ -465,8 +466,9 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
 
   window = [[self contentView] gdkWindow];
 
+  device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
   gdk_drag_context_set_device (current_context,
-                               gdk_display_get_core_pointer (gdk_display_get_default ()));
+                               gdk_device_manager_get_client_pointer (device_manager));
 
   event = gdk_event_new (GDK_DRAG_ENTER);
   event->dnd.window = g_object_ref (window);
diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c
index 442e821..73a68df 100644
--- a/gdk/quartz/gdkdnd-quartz.c
+++ b/gdk/quartz/gdkdnd-quartz.c
@@ -149,15 +149,18 @@ GdkDragContext *
 gdk_drag_begin (GdkWindow     *window,
 		GList         *targets)
 {
+  GdkDeviceManager *device_manager;
+
   g_assert (_gdk_quartz_drag_source_context == NULL);
   
   /* Create fake context */
   _gdk_quartz_drag_source_context = gdk_drag_context_new ();
   _gdk_quartz_drag_source_context->is_source = TRUE;
 
+  device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
   gdk_drag_context_set_device (_gdk_quartz_drag_source_context,
-                               gdk_display_get_core_pointer (gdk_display_get_default ()));
-  
+                               gdk_device_manager_get_client_pointer (device_manager));
+
   return _gdk_quartz_drag_source_context;
 }
 
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 6436fb7..9d429f7 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -1212,6 +1212,7 @@ target_context_new (GdkWindow *window)
   target_drag_context *result;
   GdkDragContextPrivateWin32 *private;
   GdkDevice *device;
+  GdkDeviceManager device_manager;
 
   result = g_new0 (target_drag_context, 1);
 
@@ -1221,7 +1222,8 @@ target_context_new (GdkWindow *window)
   result->context->protocol = GDK_DRAG_PROTO_OLE2;
   result->context->is_source = FALSE;
 
-  device = gdk_display_get_core_pointer (_gdk_display);
+  device_manager = gdk_display_get_device_manager (_gtk_display);
+  device = gdk_device_manager_get_client_pointer (device_manager);
   gdk_drag_context_set_device (result->context, device);
 
   result->context->source_window = NULL;
@@ -1260,7 +1262,8 @@ source_context_new (GdkWindow *window,
   result->context->protocol = GDK_DRAG_PROTO_OLE2;
   result->context->is_source = TRUE;
 
-  device = gdk_display_get_core_pointer (_gdk_display);
+  device_manager = gdk_display_get_device_manager (_gtk_display);
+  device = gdk_device_manager_get_client_pointer (device_manager);
   gdk_drag_context_set_device (result->context, device);
 
   result->context->source_window = window;
@@ -1475,6 +1478,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
   gint nfiles, i;
   gchar *fileName, *linkedFile;
   GdkDevice *device;
+  GdkDeviceManager *device_manager;
 
   if (msg->message == WM_DROPFILES)
     {
@@ -1484,7 +1488,8 @@ gdk_dropfiles_filter (GdkXEvent *xev,
       context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
       context->is_source = FALSE;
 
-      device = gdk_display_get_core_pointer (_gdk_display);
+      device_manager = gdk_display_get_device_manager (_gtk_display);
+      device = gdk_device_manager_get_client_pointer (device_manager);
       gdk_drag_context_set_device (context, device);
 
       context->source_window = _gdk_root;
@@ -1701,6 +1706,7 @@ local_send_enter (GdkDragContext *context,
   GdkDragContextPrivateWin32 *private;
   GdkDragContext *new_context;
   GdkDevice *device;
+  GdkDeviceManager *device_manager;
 
   GDK_NOTE (DND, g_print ("local_send_enter: context=%p current_dest_drag=%p\n",
 			  context,
@@ -1718,7 +1724,8 @@ local_send_enter (GdkDragContext *context,
   new_context->protocol = GDK_DRAG_PROTO_LOCAL;
   new_context->is_source = FALSE;
 
-  device = gdk_display_get_core_pointer (_gdk_display);
+  device_manager = gdk_display_get_device_manager (_gtk_display);
+  device = gdk_device_manager_get_client_pointer (device_manager);
   gdk_drag_context_set_device (new_context, device);
 
   new_context->source_window = context->source_window;
@@ -1852,12 +1859,14 @@ gdk_drag_begin (GdkWindow *window,
     {
       GdkDragContext *new_context;
       GdkDevice *device;
+      GdkDeviceManager device_manager;
 
       g_return_val_if_fail (window != NULL, NULL);
 
       new_context = gdk_drag_context_new ();
 
-      device = gdk_display_get_core_pointer (_gdk_display);
+      device_manager = gdk_display_get_device_manager (_gtk_display);
+      device = gdk_device_manager_get_client_pointer (device_manager);
       gdk_drag_context_set_device (new_context, device);
 
       new_context->is_source = TRUE;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index e2a77b6..9608304 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -2828,6 +2828,7 @@ xdnd_enter_filter (GdkXEvent *xev,
 		   GdkEvent  *event,
 		   gpointer   cb_data)
 {
+  GdkDeviceManager *device_manager;
   GdkDisplay *display;
   GdkDisplayX11 *display_x11;
   XEvent *xevent = (XEvent *)xev;
@@ -2879,7 +2880,8 @@ xdnd_enter_filter (GdkXEvent *xev,
   PRIVATE_DATA(new_context)->version = version;
 
   /* FIXME: Should extend DnD protocol to have device info */
-  gdk_drag_context_set_device (new_context, gdk_display_get_core_pointer (display));
+  device_manager = gdk_display_get_device_manager (display);
+  gdk_drag_context_set_device (new_context, gdk_device_manager_get_client_pointer (device_manager));
 
   new_context->source_window = gdk_window_lookup_for_display (display, source_window);
   if (new_context->source_window)
@@ -3168,7 +3170,8 @@ gdk_drag_begin (GdkWindow     *window,
   GdkDragContext *new_context;
   GdkDisplay *display;
   GdkDevice *device;
-  
+  GdkDeviceManager *device_manager;
+
   g_return_val_if_fail (window != NULL, NULL);
   g_return_val_if_fail (GDK_WINDOW_IS_X11 (window), NULL);
 
@@ -3183,7 +3186,8 @@ gdk_drag_begin (GdkWindow     *window,
   new_context->actions = 0;
 
   display = gdk_drawable_get_display (GDK_DRAWABLE (window));
-  device = gdk_display_get_core_pointer (display);
+  device_manager = gdk_display_get_device_manager (display);
+  device = gdk_device_manager_get_client_pointer (device_manager);
   gdk_drag_context_set_device (new_context, device);
 
   return new_context;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]