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 742790 - Tab groups focus issue
Tab groups focus issue
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-12 02:32 UTC by Robert Roth
Modified: 2015-01-17 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
set focus to view under cursor (1.86 KB, patch)
2015-01-16 18:54 UTC, sébastien lafargue
reviewed Details | Review
search: set focus to where we click (743 bytes, patch)
2015-01-17 18:00 UTC, sébastien lafargue
none Details | Review
set focus to widget under the pointer (1.42 KB, patch)
2015-01-17 21:00 UTC, sébastien lafargue
committed Details | Review

Description Robert Roth 2015-01-12 02:32:48 UTC
The tab groups functionality is brilliant, is very useful for porting. No need for several gedit windows anymore.

However, I have found the following thing annoying:
* open gedit
* open two files in different tab groups (resulting in a split view)
* search in one of them (Ctrl+F and enter search query)
* click the other tabgroup

Expected:

I would expect the tab group, and subsequently the editor I have just clicked to get focused, to be able to start editing right away

What happens instead:

The editor I have clicked doesn't get focus, only on double click. I assume the first click is used to hide the find popup, and that is why the focus doesn't change to the tab group I have just clicked.
Comment 1 Sébastien Wilmet 2015-01-13 12:28:44 UTC
Thanks for the bug report, I confirm that it's a problem that should be fixed.
Comment 2 sébastien lafargue 2015-01-16 18:54:04 UTC
Created attachment 294710 [details] [review]
set focus to view under cursor
Comment 3 sébastien lafargue 2015-01-16 23:02:18 UTC
not working if you click on the gutter and the document's header, so you must click on the text part of the view for it to work, but not sure we can do better.
Comment 4 Sébastien Wilmet 2015-01-17 11:14:16 UTC
Review of attachment 294710 [details] [review]:

I didn't investigate the problem, but I don't really like the solution, it looks like a hack. There is probably a simpler solution. See if there is a grab focus somewhere that shouldn't always be called.
Comment 5 Paolo Borelli 2015-01-17 11:59:02 UTC
It is a hack, but I am not sure we can do much better than that. The search popdown takes a grab of all the events until it is dismissed, it is not only about focus...

If we find a nicer solution I am all for it, but otherwise the patch seems acceptable, especially since it is at least self-contained. Maybe adding a proper comment

/* This is a hack: the search popdown has a grab, but if it was dismissed by clicking on another view we want to try to focus that and not the view where we are searching */

or something along those lines
Comment 6 Sébastien Wilmet 2015-01-17 12:49:08 UTC
hide_search_widget() calls gtk_widget_grab_focus() on the view (the wrong view in our case).

Did you try to move the grab focus out of the hide_search_widget() function and call it where needed? I.e. not call it in search_entry_focus_out_event().
Comment 7 sébastien lafargue 2015-01-17 18:00:00 UTC
Created attachment 294747 [details] [review]
search: set focus to where we click

ok, my bad, just removing the grab_focus is enough
Comment 8 sébastien lafargue 2015-01-17 18:18:15 UTC
Removing the grab_focus don't work with ESC and enter, so forget this patch too.
Comment 9 sébastien lafargue 2015-01-17 21:00:39 UTC
Created attachment 294755 [details] [review]
set focus to widget under the pointer

commited as bff9c09 on master
commited as bb02bf0 on 3.14
Comment 10 sébastien lafargue 2015-01-17 21:02:09 UTC
This problem has been fixed in our software repository. The fix will go into the next software release and the next major software release. Thank you for your bug report.