GNOME Bugzilla – Bug 765551
When searching, pressing 'spacebar' selects the file
Last modified: 2018-05-02 17:04:59 UTC
When filtering files by typing, pressing 'spacebar' opens the selected file - as if 'Enter' was pressed. So it's not possible to search for a file that has spaces in its name.
I just noticed why this happens: if you press a key or click the search button the file list is still active, when the cursor should be shifted to the search bar. If you click on the search bar then you can press the space key without selecting a file.
Confirmed. Seems inadvisable IMHO. Anyway, this is deliberately coded in gtkfilechooserwidget.c: if ((event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_ISO_Enter || event->keyval == GDK_KEY_KP_Enter || event->keyval == GDK_KEY_space || event->keyval == GDK_KEY_KP_Space) && !(event->state & gtk_accelerator_get_default_mod_mask ()) && !(priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) { /* Activate default widget of FCW's toplevel */ }
(In reply to Daniel Boles from comment #2) > Confirmed. Seems inadvisable IMHO. > > Anyway, this is deliberately coded in gtkfilechooserwidget.c: > > if ((event->keyval == GDK_KEY_Return > || event->keyval == GDK_KEY_ISO_Enter > || event->keyval == GDK_KEY_KP_Enter > || event->keyval == GDK_KEY_space > || event->keyval == GDK_KEY_KP_Space) > && !(event->state & gtk_accelerator_get_default_mod_mask ()) > && !(priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || > priv->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) > { /* Activate default widget of FCW's toplevel */ } Yes, but why space? Removing these lines should fix this: || event->keyval == GDK_KEY_space || event->keyval == GDK_KEY_KP_Space)
Yes, it's obvious how to fix it. The question is whether the maintainers will want to.
...fwiw, my opinion is that it should be fixed; the Return/Enter set give enough shortcuts that stealing Space for the same purpose is not justifiable, compared to what it loses.
*** Bug 775544 has been marked as a duplicate of this bug. ***
*** Bug 773193 has been marked as a duplicate of this bug. ***
> Return/Enter set give enough shortcuts that stealing Space for the same purpose is not justifiable :+1: Space should activate the focused/default widget only when not in an input field
The problem is that the focus is *not* in the input field, but rather it's on the main content area of the FileChooser, and that just happens to redirect keys other than Space et al. to search and populate the input field.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/616.