Skip to content

Commit

Permalink
Ensure overlay appears after rubberband selection in ListView (#2156)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo <[email protected]>
  • Loading branch information
Jeremy Wootten and lenemter authored Mar 12, 2023
1 parent 514432a commit 75fe88a
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/View/AbstractDirectoryView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,6 @@ namespace Files {
uint button;
event.get_coords (out x, out y);
event.get_button (out button);
update_selected_files_and_menu ();
/* Only take action if pointer has not moved */
if (!Gtk.drag_check_threshold (get_child (), (int)drag_x, (int)drag_y, (int)x, (int)y)) {
if (should_activate) {
Expand All @@ -3656,23 +3655,20 @@ namespace Files {
});
} else if (should_deselect && click_path != null) {
unselect_path (click_path);
/* Only need to update selected files if changed by this handler */
Idle.add (() => {
update_selected_files_and_menu ();
return GLib.Source.REMOVE;
});
} else if (should_select && click_path != null) {
select_path (click_path);
/* Only need to update selected files if changed by this handler */
Idle.add (() => {
update_selected_files_and_menu ();
return GLib.Source.REMOVE;
});
} else if (button == Gdk.BUTTON_SECONDARY) {
show_context_menu (event);
}
}

// Selection may have been changed *but not signalled* by rubberbanding
// in Gtk.TreeView (IconView does signal during rubberbanding)
Idle.add (() => {
update_selected_files_and_menu ();
return GLib.Source.REMOVE;
});

should_activate = false;
should_deselect = false;
should_select = false;
Expand Down

0 comments on commit 75fe88a

Please sign in to comment.