GNOME Bugzilla – Bug 742422
Single tab with no focus after dnd
Last modified: 2015-01-09 22:13:07 UTC
Two g-t windows: one with tabs A and B, the other one with a single tab C. Drag-n-drop tab B next to C. The first window still has the WM focus, yet its only terminal A is not focused, you can't type into it. Changing WM focus back-n-forth doesn't help. Pressing TAB, or clicking inside the terminal repairs this situation. I assume the Gtk+ focus is still on the no longer visible tab bar. I think in this case the Gtk+ focus should be forced to the vte widget.
Yes, shoudl gtk_widget_grab_focus on the active screen if after a DND op there's only one tab in the window and the focus was in the notebook.
Created attachment 294118 [details] [review] Fix Something like this I guess... I'm not checking if the focus was on the tab bar; where else could it be? And even if it's somewhere else, it's still nice to grab it :)
It would also be nice if the target window would receive WM focus, so that you can immediately work in the just dragged tab. But I'm afraid it's beyond our control to perform WM operations.
That's what present_on_insert in terminal-window.c is supposed to do... might have broken.
Comment on attachment 294118 [details] [review] Fix Note: the same story (and fixed by the same patch) when closing the 2nd tab with the tab's X button whereas the 1st tab label is focused.
I'm no longer sure we should focus the destination window - at least checked gedit and firefox, neither of them does. The orig bug is fixed now.