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 706900 - File browser: file content should have focus after opening
File browser: file content should have focus after opening
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-27 14:57 UTC by Martin Meyer
Modified: 2019-03-23 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
File browser: grab focus to the GeditView after opening a file (1.11 KB, patch)
2013-08-31 17:37 UTC, Sébastien Wilmet
rejected Details | Review

Description Martin Meyer 2013-08-27 14:57:24 UTC
When I open a document from the File Browser Panel in the sidebar, the sidebar retains focus. This means when I do CTRL+F to search in the document I just opened, it tries to search for a matching file instead. This is a pretty frustrating usability issue, and should be easy to fix. CTRL+I does properly switch focus to the file content, so the behavior is also inconsistent.
Comment 1 Sébastien Wilmet 2013-08-31 17:37:13 UTC
Created attachment 253705 [details] [review]
File browser: grab focus to the GeditView after opening a file
Comment 2 Sébastien Wilmet 2013-08-31 18:40:03 UTC
Review of attachment 253705 [details] [review]:

As gregier explained on IRC, the problem has already been fixed in the past:
https://git.gnome.org/browse/gedit/commit/?id=139db33451057858f196be29f567b7c37140c70b

So the bug should be fixed somewhere else.
Comment 3 Sébastien Wilmet 2013-08-31 21:08:21 UTC
I don't have a good understanding of the code in the file browser, with the button_press_event().

gregier, you added the row_activated() recently:

https://git.gnome.org/browse/gedit/commit/?id=0701c9c4639c93e6f

Now the activate_selected_items() is called two times. One with the row-activated, and one in the button_press_event():

https://git.gnome.org/browse/gedit/tree/plugins/filebrowser/gedit-file-browser-view.c#n582

The "row-activated" signal is actually emitted when
widget_parent->button_press_event (widget, event);
is running.

Maybe the button_press_event() can be simplified. It seems a bit complicated for what it is.

Or gedit_commands_load_location() can always grab the focus to the GeditView, even if the file is already loaded.