After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608831 - nautilus forgets selection on often refreshes
nautilus forgets selection on often refreshes
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.29.x
Other Linux
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-02 19:25 UTC by Pedro Villavicencio
Modified: 2012-09-05 14:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
Don't reload while a reload is ongoing (1.03 KB, patch)
2012-09-05 07:53 UTC, William Jon McCann
committed Details | Review

Description Pedro Villavicencio 2010-02-02 19:25:17 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/nautilus/+bug/515934

"The test case for this bug is very simple:

1) Open a folder in nautilus, for instance your home folder
2) Select few files with a mouse
3) Press f5 and keep it pressed for 3-5 seconds, making as much refreshes as possible.
4) Release f5 button

==> Expected: when f5 button is released, files selected on step 2 should stay selected
==> Actual: no files are selected"

Thanks,
Comment 1 Fabio Durán Verdugo 2010-02-02 19:37:15 UTC
Yes if you press a long time F5 the files no selected (Nautilus 2.29.2)
Change to NEW status
Comment 2 William Jon McCann 2012-09-05 07:53:28 UTC
Created attachment 223500 [details] [review]
Don't reload while a reload is ongoing

This prevents the pending selection from getting stepped on by
another reload request.
Comment 3 Cosimo Cecchi 2012-09-05 13:47:23 UTC
Review of attachment 223500 [details] [review]:

::: src/nautilus-window-manage-views.c
@@ +1828,3 @@
+	    || nautilus_view_get_loading (slot->content_view)) {
+		/* there is a reload in flight */
+		return;

Did you make this condition just by checking at what begin_location_change() and friends generally set when refreshing?
I think this is fine for now, but I would really like to split the concept of a "location change/refresh" to a separate object and clean up all that messy code a little bit.
Comment 4 William Jon McCann 2012-09-05 13:51:35 UTC
Review of attachment 223500 [details] [review]:

::: src/nautilus-window-manage-views.c
@@ +1828,3 @@
+	    || nautilus_view_get_loading (slot->content_view)) {
+		/* there is a reload in flight */
+		return;

The key part with respect to this bug is the get_loading() part because nautilus_view_set_selection does completely different things depending on whether the view is loading or not. It is indeed a mess. It is even worse that set_selection and get_selection are not symmetric at all. You can set_selection and then get_selection and the selection you get back isn't the one you started with. That's pretty broken I think. But for now this works around it.