summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-tree-view-drag-dest.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcaja-private/caja-tree-view-drag-dest.c')
-rw-r--r--libcaja-private/caja-tree-view-drag-dest.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c
index accf7bb5..405ec141 100644
--- a/libcaja-private/caja-tree-view-drag-dest.c
+++ b/libcaja-private/caja-tree-view-drag-dest.c
@@ -102,6 +102,10 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
{
GdkRectangle visible_rect;
GtkAdjustment *vadjustment;
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GdkDeviceManager *manager;
+ GdkDevice *pointer;
+#endif
GdkWindow *window;
int y;
int offset;
@@ -111,11 +115,16 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
#if GTK_CHECK_VERSION(3, 0, 0)
vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
+
+ manager = gdk_display_get_device_manager (gtk_widget_get_display (GTK_WIDGET (tree_view)));
+ pointer = gdk_device_manager_get_client_pointer (manager);
+ gdk_window_get_device_position (window, pointer,
+ NULL, &y, NULL);
#else
vadjustment = gtk_tree_view_get_vadjustment (tree_view);
-#endif
gdk_window_get_pointer (window, NULL, &y, NULL);
+#endif
y += gtk_adjustment_get_value (vadjustment);