diff options
author | Sayan Bhattacharjee <bsayan8086@gmail.com> | 2023-04-07 19:16:15 +0000 |
---|---|---|
committer | Corey Berla <corey@berla.me> | 2023-04-07 19:16:15 +0000 |
commit | b44ebcfb6a71f3dfbbfee3a8781d551995609cd0 (patch) | |
tree | d653beded98c9f1c9d4e0c91284a713e74b00d10 /src/gtk/nautilusgtkplacessidebar.c | |
parent | f0e2a3166c22e813a8984c3043cf88827b7c8c8b (diff) | |
download | nautilus-b44ebcfb6a71f3dfbbfee3a8781d551995609cd0.tar.gz |
sidebar: Prevent auto folder opening on hover when re-ordering bookmarks
In the sidebar, when dragging to re-order bookmarks,
other bookmarked folders are automatically opening while hovering
over them as it happens during a drag-and-drop operation.
This action should not be permitted because it is inconceivable to
drag-and-drop a bookmark into another bookmark.
Implement a check to prevent automatically navigating
into the bookmarked folders if they are hovered on while dragging
a bookmark with the intent to just re-order them.
It achieves this behavior by not adding a navigation hover timeout
if we are dragging a row (bookmark) in the sidebar.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2820
Diffstat (limited to 'src/gtk/nautilusgtkplacessidebar.c')
-rw-r--r-- | src/gtk/nautilusgtkplacessidebar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gtk/nautilusgtkplacessidebar.c b/src/gtk/nautilusgtkplacessidebar.c index d7e6e97d3..193c50d72 100644 --- a/src/gtk/nautilusgtkplacessidebar.c +++ b/src/gtk/nautilusgtkplacessidebar.c @@ -1656,8 +1656,9 @@ drag_motion_callback (GtkDropTarget *target, row = gtk_list_box_get_row_at_y (GTK_LIST_BOX (sidebar->list_box), y); start = sidebar->hover_start_point; - if (row != sidebar->hover_row || - gtk_drag_check_threshold (GTK_WIDGET (sidebar), start.x, start.y, x, y)) + if (sidebar->drag_row == NULL && + (row != sidebar->hover_row || + gtk_drag_check_threshold (GTK_WIDGET (sidebar), start.x, start.y, x, y))) { g_clear_handle_id (&sidebar->hover_timer_id, g_source_remove); sidebar->hover_row = row; |