[gtk+/xi2-playground: 15/15] GtkWindow: Use client pointer on pointer-dependent positioning.



commit 974e0948ee246e2ac45b99a1050660b7457882ab
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jun 8 15:19:32 2010 +0200

    GtkWindow: Use client pointer on pointer-dependent positioning.
    
    GTK_WIN_POS_MOUSE and GTK_WIN_POS_CENTER* now work relatively to the client
    pointer.

 gtk/gtkwindow.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 942c30e..7e3c735 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5796,11 +5796,13 @@ get_monitor_containing_pointer (GtkWindow *window)
   GdkScreen *window_screen;
   GdkScreen *pointer_screen;
   GdkDisplay *display;
+  GdkDeviceManager *device_manager;
   GdkDevice *pointer;
 
   window_screen = gtk_window_check_screen (window);
   display = gdk_screen_get_display (window_screen);
-  pointer = gdk_display_get_core_pointer (display);
+  device_manager = gdk_display_get_device_manager (display);
+  pointer = gdk_device_manager_get_client_pointer (device_manager);
 
   gdk_display_get_device_state (display, pointer,
                                 &pointer_screen,
@@ -5988,12 +5990,15 @@ gtk_window_compute_configure_request (GtkWindow    *window,
 	    gint monitor_num;
 	    GdkRectangle monitor;
             GdkDisplay *display;
+            GdkDeviceManager *device_manager;
             GdkDevice *pointer;
             GdkScreen *pointer_screen;
             gint px, py;
 
             display = gdk_screen_get_display (screen);
-            pointer = gdk_display_get_core_pointer (display);
+            device_manager = gdk_display_get_device_manager (display);
+            pointer = gdk_device_manager_get_client_pointer (device_manager);
+
             gdk_display_get_device_state (display, pointer,
                                           &pointer_screen,
                                           &px, &py, NULL);



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