summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-08-05 20:29:32 +0100
committerOndrej Holy <oholy@redhat.com>2021-11-22 15:16:18 +0000
commitad2fcd7b6d59779614251d1898176a23579326d1 (patch)
treecc10cc00cdc19e86c524250b5b601257b482efe8
parentd32c24c26683555218332a516635b85ee3c7183f (diff)
downloadnautilus-ad2fcd7b6d59779614251d1898176a23579326d1.tar.gz
tree-view-drag-dest: Don't use gdk_window_get_position()
It's gone in GTK4. Instead, translate to widget coordinates.
-rw-r--r--src/nautilus-tree-view-drag-dest.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/nautilus-tree-view-drag-dest.c b/src/nautilus-tree-view-drag-dest.c
index 01d080455..2a98181b4 100644
--- a/src/nautilus-tree-view-drag-dest.c
+++ b/src/nautilus-tree-view-drag-dest.c
@@ -593,7 +593,7 @@ drag_motion_callback (GtkWidget *widget,
GtkTreePath *path;
GtkTreePath *drop_path, *old_drop_path;
GtkTreeViewDropPosition pos;
- GdkWindow *bin_window;
+ int bin_y;
guint action;
gboolean res = TRUE;
@@ -621,16 +621,13 @@ drag_motion_callback (GtkWidget *widget,
drop_path = get_drop_path (dest, path);
action = 0;
- bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
- if (bin_window != NULL)
+ gtk_tree_view_convert_bin_window_to_widget_coords (GTK_TREE_VIEW (widget),
+ 0, 0,
+ NULL, &bin_y);
+ if (bin_y <= y)
{
- int bin_x, bin_y;
- gdk_window_get_position (bin_window, &bin_x, &bin_y);
- if (bin_y <= y)
- {
- /* ignore drags on the header */
- action = get_drop_action (dest, context, drop_path);
- }
+ /* ignore drags on the header */
+ action = get_drop_action (dest, context, drop_path);
}
gtk_tree_view_get_drag_dest_row (GTK_TREE_VIEW (widget), &old_drop_path,