GNOME Bugzilla – Bug 608831
nautilus forgets selection on often refreshes
Last modified: 2012-09-05 14:10:02 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,
Yes if you press a long time F5 the files no selected (Nautilus 2.29.2) Change to NEW status
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.
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.
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.