[gtk+/xi2] GtkWindow: Make GtkWindowPosition obey core pointer position.



commit 097f1501d5fa4dd5021eb47b9ce213423ba747fe
Author: Carlos Garnacho <carlos gnome org>
Date:   Thu Dec 24 01:33:57 2009 +0100

    GtkWindow: Make GtkWindowPosition obey core pointer position.
    
    The core pointer (as in gdk_display_get_core_pointer) is now explicitly
    used to determine window position, either for GTK_WIN_POS_MOUSE, or
    for monitor detection.

 gtk/gtkwindow.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 69dcf8c..8eff180 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5712,11 +5712,16 @@ get_monitor_containing_pointer (GtkWindow *window)
   gint monitor_num;
   GdkScreen *window_screen;
   GdkScreen *pointer_screen;
+  GdkDisplay *display;
+  GdkDevice *pointer;
 
   window_screen = gtk_window_check_screen (window);
-  gdk_display_get_pointer (gdk_screen_get_display (window_screen),
-                           &pointer_screen,
-                           &px, &py, NULL);
+  display = gdk_screen_get_display (window_screen);
+  pointer = gdk_display_get_core_pointer (display);
+
+  gdk_display_get_device_state (display, pointer,
+                                &pointer_screen,
+                                &px, &py, NULL);
 
   if (pointer_screen == window_screen)
     monitor_num = gdk_screen_get_monitor_at_point (pointer_screen, px, py);
@@ -5899,12 +5904,16 @@ gtk_window_compute_configure_request (GtkWindow    *window,
             gint screen_height = gdk_screen_get_height (screen);
 	    gint monitor_num;
 	    GdkRectangle monitor;
+            GdkDisplay *display;
+            GdkDevice *pointer;
             GdkScreen *pointer_screen;
             gint px, py;
-            
-            gdk_display_get_pointer (gdk_screen_get_display (screen),
-                                     &pointer_screen,
-                                     &px, &py, NULL);
+
+            display = gdk_screen_get_display (screen);
+            pointer = gdk_display_get_core_pointer (display);
+            gdk_display_get_device_state (display, pointer,
+                                          &pointer_screen,
+                                          &px, &py, NULL);
 
             if (pointer_screen == screen)
               monitor_num = gdk_screen_get_monitor_at_point (screen, px, py);



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