GNOME Bugzilla – Bug 742790
Tab groups focus issue
Last modified: 2015-01-17 21:02:09 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.
Thanks for the bug report, I confirm that it's a problem that should be fixed.
Created attachment 294710 [details] [review] set focus to view under cursor
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.
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.
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
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().
Created attachment 294747 [details] [review] search: set focus to where we click ok, my bad, just removing the grab_focus is enough
Removing the grab_focus don't work with ESC and enter, so forget this patch too.
Created attachment 294755 [details] [review] set focus to widget under the pointer commited as bff9c09 on master commited as bb02bf0 on 3.14
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.