gtkxpaned: Avoid deprecated gtk_widget_get_pointer().
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 30 Jul 2013 05:55:18 +0000 (22:55 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 30 Jul 2013 05:55:18 +0000 (22:55 -0700)
lib/gtk-contrib/gtkxpaned.c

index 29f5b4dc168020568783c0791d64006a2e878c2b..8bd5253deae0f8c75db34c273b51d87b61931fcb 100644 (file)
@@ -1468,12 +1468,18 @@ static void
 update_drag (GtkXPaned * xpaned)
 {
   GdkPoint pos;
+  GtkWidget *widget = GTK_WIDGET (xpaned);
   gint handle_size;
   GtkRequisition size;
   GtkAllocation allocation;
-  gtk_widget_get_allocation (GTK_WIDGET (xpaned), &allocation);
 
-  gtk_widget_get_pointer (GTK_WIDGET (xpaned), &pos.x, &pos.y);
+  gtk_widget_get_allocation (widget, &allocation);
+
+  gdk_window_get_device_position (gtk_widget_get_window (widget),
+                                  gdk_device_manager_get_client_pointer (
+                                    gdk_display_get_device_manager (
+                                      gtk_widget_get_display (widget))),
+                                  &pos.x, &pos.y, NULL);
 
   if (xpaned->in_drag_vert)
     {
@@ -1481,8 +1487,7 @@ update_drag (GtkXPaned * xpaned)
 
       if (is_rtl (xpaned))
         {
-          gtk_widget_style_get (GTK_WIDGET (xpaned),
-                                "handle-size", &handle_size, NULL);
+          gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
 
           size.height = allocation.height - pos.y - handle_size;
         }
@@ -1506,8 +1511,7 @@ update_drag (GtkXPaned * xpaned)
 
       if (is_rtl (xpaned))
         {
-          gtk_widget_style_get (GTK_WIDGET (xpaned),
-                                "handle-size", &handle_size, NULL);
+          gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
 
           size.width = allocation.width - pos.x - handle_size;
         }
@@ -1532,8 +1536,7 @@ update_drag (GtkXPaned * xpaned)
 
       if (is_rtl (xpaned))
         {
-          gtk_widget_style_get (GTK_WIDGET (xpaned),
-                                "handle-size", &handle_size, NULL);
+          gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
 
           size.width = allocation.width - pos.x - handle_size;
           size.height = allocation.height - pos.y - handle_size;