[Xfce4-commits] [xfce/thunar] 02/06: Replace gdk_window_get_pointer by gdk_window_get_device_position

noreply at xfce.org noreply at xfce.org
Sat Jun 2 06:52:25 CEST 2018


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/thunar.

commit aa62a1b439ed0b2b3f422c2f18d652b469003740
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sat Jun 2 01:26:10 2018 -0300

    Replace gdk_window_get_pointer by gdk_window_get_device_position
---
 thunar/thunar-standard-view.c | 11 +++++++++--
 thunar/thunar-tree-view.c     | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index fc53e72..49fd163 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -3949,6 +3949,9 @@ thunar_standard_view_drag_scroll_timer (gpointer user_data)
 {
   ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (user_data);
   GtkAdjustment      *adjustment;
+  GdkWindow          *window;
+  GdkSeat            *seat;
+  GdkDevice          *pointer;
   gfloat              value;
   gint                offset;
   gint                y, x;
@@ -3960,8 +3963,12 @@ thunar_standard_view_drag_scroll_timer (gpointer user_data)
   if (G_LIKELY (gtk_widget_get_realized (GTK_WIDGET (standard_view))))
     {
       /* determine pointer location and window geometry */
-      gdk_window_get_pointer (gtk_widget_get_window (gtk_bin_get_child (GTK_BIN (standard_view))), &x, &y, NULL);
-      gdk_window_get_geometry (gtk_widget_get_window (gtk_bin_get_child (GTK_BIN (standard_view))), NULL, NULL, &w, &h);
+      window = gtk_widget_get_window (gtk_bin_get_child (GTK_BIN (standard_view)));
+      seat = gdk_display_get_default_seat (gdk_display_get_default ());
+      pointer = gdk_seat_get_pointer (seat);
+
+      gdk_window_get_device_position (window, pointer, &x, &y, NULL);
+      gdk_window_get_geometry (window, NULL, NULL, &w, &h);
 
       /* check if we are near the edge (vertical) */
       offset = y - (2 * 20);
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index 6a0cbe3..b11f4a8 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -2633,6 +2633,9 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
   GtkTreePath    *start_path;
   GtkTreePath    *end_path;
   GtkTreePath    *path;
+  GdkWindow      *window;
+  GdkSeat        *seat;
+  GdkDevice      *pointer;
   gfloat          value;
   gint            offset;
   gint            y, h;
@@ -2643,8 +2646,12 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
   if (gtk_widget_get_realized (GTK_WIDGET (view)))
     {
       /* determine pointer location and window geometry */
-      gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (view)), NULL, &y, NULL);
-      gdk_window_get_geometry (gtk_widget_get_window (GTK_WIDGET (view)), NULL, NULL, NULL, &h);
+      window = gtk_widget_get_window (GTK_WIDGET (view));
+      seat = gdk_display_get_default_seat (gdk_display_get_default ());
+      pointer = gdk_seat_get_pointer (seat);
+
+      gdk_window_get_device_position (window, pointer, NULL, &y, NULL);
+      gdk_window_get_geometry (window, NULL, NULL, NULL, &h);
 
       /* check if we are near the edge */
       offset = y - (2 * 20);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list