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 378202 - There is no easy way to select the file with focus in files part
There is no easy way to select the file with focus in files part
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Keyboardability
2.23.x
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 488815 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-22 19:00 UTC by Amir Khosroshahi
Modified: 2008-07-02 16:14 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Patch to select icon with space bar when there's no icon selected (949 bytes, patch)
2008-06-27 11:52 UTC, Nelson Benitez
rejected Details | Review
Now using short if version (941 bytes, patch)
2008-06-27 12:21 UTC, Nelson Benitez
none Details | Review

Description Amir Khosroshahi 2006-11-22 19:00:30 UTC
For example, after you delete a file using keyboard (Del key), the focus still remains on the files part of the Nautilus, and a file item seems to be focused (A dotted-line box is drawn around it). To select (highlight) this file using keyboard, you can only do the following: Use arrow keys to select one of the files beside this file and again go back to the file you intended to select. This means that you should select the file by pressing "left" and then "right" arrow key (Or "up" and then "down" arrow key).

Furthermore, if you delete every other file in the folder, and just one file remains, then you can not even use the above method, and you simply can't select the file using keyboard!!

This seems very inconvenient. This makes keyboarding of Nautilus a bad experience for keyboarders! It would be better if we could select a focused file by just pressing "space bar" (As it is done in Windows).
Comment 1 Cosimo Cecchi 2008-02-10 21:57:33 UTC
*** Bug 488815 has been marked as a duplicate of this bug. ***
Comment 2 Cosimo Cecchi 2008-02-10 21:58:26 UTC
Confirming and adding 'usability' keyword.
Comment 3 Nelson Benitez 2008-06-27 10:25:05 UTC
It seems(In reply to comment #0)
> 
> Furthermore, if you delete every other file in the folder, and just one file
> remains, then you can not even use the above method, and you simply can't
> select the file using keyboard!!

 This part is dup of bug 540107
Comment 4 Nelson Benitez 2008-06-27 10:45:19 UTC
(In reply to comment #0)
> For example, after you delete a file using keyboard (Del key), the focus still
> remains on the files part of the Nautilus, and a file item seems to be focused
> (A dotted-line box is drawn around it). To select (highlight) this file using
> keyboard, you can only do the following: Use arrow keys to select one of the
> files beside this file and again go back to the file you intended to select.
> This means that you should select the file by pressing "left" and then "right"
> arrow key (Or "up" and then "down" arrow key).

You can select the file by pressing CONTROL + SPACE bar... I've discovered it reading nautilus source code.

> 
> This seems very inconvenient. This makes keyboarding of Nautilus a bad
> experience for keyboarders! It would be better if we could select a focused
> file by just pressing "space bar" (As it is done in Windows).
> 

I also think it's much more discoverable as SPACE bar rather than CONTROL + SPACE bar.
Comment 5 Nelson Benitez 2008-06-27 11:52:37 UTC
Created attachment 113524 [details] [review]
Patch to select icon with space bar when there's no icon selected

Well, it's clear that 'space' is better that 'ctrl+space', but nautilus uses space bar to activate selected items, but our main case to use 'space' is when there is no icon selected, because we want to select some one,... so no problem, because when there is no icon selected we can't activate any icon with the bar, so in this case (when there's no selected icons) we make the 'space' bar act as if was 'control+space'. That's what the patch does.

To summarize, currently, when there's any icon selected, pressing space bar causes nothing (as there's anything to activate), but with the patch it'll cause the current keyboard_focused_icon to get selected (i.e. like if we pressed 'ctrl+space'). 

Seems like a good approaching to me.
Comment 6 A. Walton 2008-06-27 12:11:58 UTC
Same thing as your patch as a one-liner instead (which also avoids the extra allocation this patch adds):

-	if ((event->state & GDK_CONTROL_MASK) != 0) {
+	if ((event->state & GDK_CONTROL_MASK) != 0 || !has_selection (container)) {

Not that I've had time enough to test it, but it sounds sane to me.
Comment 7 A. Walton 2008-06-27 12:21:09 UTC
Works as advertised. Ack from me.
Comment 8 Nelson Benitez 2008-06-27 12:21:27 UTC
Created attachment 113528 [details] [review]
Now using short if version

Oh,, thanks for the suggestion :), I didn't know that using the large version added extra allocation,, good to know :)

I've updated the patch.
Comment 9 A. Walton 2008-06-27 12:35:03 UTC
Heh, I think you missed my meaning: we have a function in nautilus-icon-container called "has_selection()" 
[
nautilus-icon-container.c:6896:
static gboolean 
has_selection (NautilusIconContainer *container)
]

The one liner patch in #6 skips the extra list allocation/free, is easier to read, and implements the same behavior (and it works as you explained).
Comment 10 Nelson Benitez 2008-06-27 12:53:39 UTC
Oh, sorry for the misunderstanding.. ok, the one-liner in comment 6 is better of course.. Thanks
Comment 11 Amir Khosroshahi 2008-06-28 11:26:55 UTC
Oh, thank you very much guys for your paying attention to this issue. I didn't know that 'ctrl+space' does what I wanted to do, so there was some (non-easy) way to select the file ;)

But, anyway, the patched that you have prepared looks very useful. Will it be merged in the next version of GNOME?
Comment 12 Christian Neumair 2008-06-28 11:36:29 UTC
Thanks for your efforts, I committed another patch to trunk and to the GNOME 2.22 branch:

http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14285
http://svn.gnome.org/viewvc/nautilus?view=revision&revision=14286

2008-06-28  Christian Neumair  <cneumair@gnome.org>

	* libnautilus-private/nautilus-icon-container.c (keyboard_move_to),
	(keyboard_space):
	If no icon is selected, but an icon has the keyboard focus, select it
	when pressing space. Thanks to Nelson Benítez León, A. Walton and Amir
	Reza Khosroshahi. Fixes #378202.

It ensures that the keyboard focus is cleared, and that the icon is used as range selection base.

Closing as fixed.
Comment 13 Calum Benson 2008-07-02 16:14:31 UTC
Cc'ing Vincent Alexander on this change-- may need to be documented in the keynav chapter of the accessibility guide.