Skip to content

Files-view: Make some key accelerators widget-scoped instead of globally

Vanadiae requested to merge Vanadiae/nautilus:fix-global-accel-files-view into master

Currently it is not possible to activate any UI element with Enter on the keyboard, because it always activates either the selected file in the files view, or it activates the secondary menu next to the path. This is because a) NautilusFilesView registers a global application accelerator for Enter/Return, to activate the selected files, b) it should really not have registered a custom shortcut for that to begin with, instead it should use the grid view or list view's "(row-)activate(d)" signals, which is already the case for the later.

This commit hence drops this Enter/Return global accelerator, and hooks up the NautilusIconViewController to its grid view's "activated" signal. While testing around the GTK4 Nautilus, I noticed that the context menu showed using the Menu key was the one for the files view when I had the sidebar focused. I hence noticed that there was more problematic global shortcuts that conflicted with other uses (e.g. for the sidebar). These were F2, Delete and the menu key, all which were switched to a key event controller, with its default bubble phase that does not cause this issue.

Fixes #2225 (closed)

Merge request reports