summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-26 21:36:17 +0200
committerraveit65 <[email protected]>2016-07-04 14:40:52 +0200
commit8e7097e89a04156ae0d2dc487f630e259ec6fb76 (patch)
tree8d5ce0ff1ee3da6909c1d5dfad405c747b96b21f
parente8faf61c1af5de5e7a5292d4e637236800c97842 (diff)
downloadcaja-8e7097e89a04156ae0d2dc487f630e259ec6fb76.tar.bz2
caja-8e7097e89a04156ae0d2dc487f630e259ec6fb76.tar.xz
GTK+-3.20 caja-tree-view-drag-dest: use GdkSeat operations
Some GdkDisplay operations have been deprecated in GDK 3.20. This commit replaces the deprecated code with new GdkSeat operations. https://bugzilla.gnome.org/show_bug.cgi?id=762235 taken from: https://git.gnome.org/browse/nautilus/commit/?id=38a811c
-rw-r--r--libcaja-private/caja-tree-view-drag-dest.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libcaja-private/caja-tree-view-drag-dest.c b/libcaja-private/caja-tree-view-drag-dest.c
index 405ec141..96364f53 100644
--- a/libcaja-private/caja-tree-view-drag-dest.c
+++ b/libcaja-private/caja-tree-view-drag-dest.c
@@ -102,7 +102,11 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
{
GdkRectangle visible_rect;
GtkAdjustment *vadjustment;
-#if GTK_CHECK_VERSION(3, 0, 0)
+#if GTK_CHECK_VERSION (3, 20, 0)
+ GdkDisplay *display;
+ GdkSeat *seat;
+ GdkDevice *pointer;
+#elif GTK_CHECK_VERSION(3, 0, 0)
GdkDeviceManager *manager;
GdkDevice *pointer;
#endif
@@ -113,7 +117,15 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view)
window = gtk_tree_view_get_bin_window (tree_view);
-#if GTK_CHECK_VERSION(3, 0, 0)
+#if GTK_CHECK_VERSION (3, 20, 0)
+ vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(tree_view));
+
+ display = gtk_widget_get_display (GTK_WIDGET (tree_view));
+ seat = gdk_display_get_default_seat (display);
+ pointer = gdk_seat_get_pointer (seat);
+ gdk_window_get_device_position (window, pointer,
+ NULL, &y, NULL);
+#elif 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)));