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 509432 - Incorrect "X selected items" count in status bar
Incorrect "X selected items" count in status bar
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: Icon View
2.21.x
Other All
: Normal normal
: ---
Assigned To: Paweł Paprota
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-01-14 17:52 UTC by ih82b
Modified: 2008-04-26 22:43 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
509432-always-use-rubberband-select.patch (1.70 KB, patch)
2008-04-24 19:36 UTC, Paweł Paprota
reviewed Details | Review

Description ih82b 2008-01-14 17:52:25 UTC
Please describe the problem:
After doing some selections/deselections, the status bar does not tell the truth about how many files/folders are currently selected

Steps to reproduce:
1. Open a folder containing several files or subfolders, and view it as icons.
2. Click on any file to select it - choose a file which is not shown on the far left of the window. The status bar now shows information about the single selected item.
3. Hold SHIFT, and press LEFT to add the item shown to left of the selected item. Two files will be selected, and the status bar will change to reflect this.
4. Hold SHIFT again, and press RIGHT to deselect the file that was just added to the selection, so that only one item is selected. Now, the status bar is NOT updated, and still says two items are selected.


Actual results:
(See reproduction)

Expected results:
(Obvious)

Does this happen every time?
Yes, tested on two different computers, both running Ubuntu.

Other information:
Comment 1 ih82b 2008-01-14 18:01:45 UTC
Forgot to explain: It can be reproduced in MANY ways, basically selecting any number (2+) of files using any method and then deselecting all but one using only the keyboard and holding the SHIFT-key.

In fact, if selecting a couple of random files using the mouse and then playing around with the SHIFT+direction keys reveal more strange behaviours (which files are selected/deselected become very unpredictable).
Comment 2 Cosimo Cecchi 2008-01-14 23:54:50 UTC
This happens also in 2.21.5 but not in list mode. Confirming.
Comment 3 Christian Kirbach 2008-01-29 20:23:29 UTC
Could be related to bug 512894
Comment 4 Paweł Paprota 2008-04-24 19:36:34 UTC
Created attachment 109853 [details] [review]
509432-always-use-rubberband-select.patch

- always use rubberband_select() method for selecting - drop select_one_unselect_others() which seemed redundant and did not cause selection_changed signal to be emitted

- removed g_assert on icon->was_selected_before_rubberband - I discussed that with awalton on IRC and he agreed that it was unnecessary to check it for a bit

- I'm not sure about atk notification - I put it there because it's also emitted from select_one_unselect_others() and select_range() but feel free to correct me on that one
Comment 5 Paweł Paprota 2008-04-26 11:59:59 UTC
We talked yesterday on IRC about my patch above and you suggested to keep it simple, possibly one-liner. However, I'm not sure if that's really possible because of how keyboard_move_to() is currently implemented. Specifically, there's a call to select_one_unselect_others() which selects one icon but doesn't emit selection_changed (even when selection has changed).

Now, even when we remove "container->details->keyboard_rubberband_start != icon" from if() and rubberband_select() is called when we move focus "back" to where we started, selection_changed isn't emitted because rubberband_select() doesn't change anything - because select_one_unselect_others() already did.

I hope this makes sense to you. I still believe this redundant selection can be safely removed, the only thing I'm not sure about is atk notification.
Comment 6 Christian Kirbach 2008-04-26 21:43:07 UTC
Whatever may be the proper approach coding-wise I've just successfully tested the patch and I could not spot any side-effects.
Comment 7 Christian Neumair 2008-04-26 22:43:09 UTC
Paweł: You are right that the select_one_unselect_others() call breaks the selection change notification. You did not mention this in your original comment 4, though, so I thought the change was purely cosmetic.

I was not very happy with the ATK call because you placed it outside the functions actually dealing with selection/keynav.

I just committed a slightly different patch which moves the focus tracking to the selection/keynav functions - to trunk and to the GNOME 2.22 branch:

http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14092
http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14093

Closing, thanks for your efforts.