There's a problem with undocked menu bars and icon bars. If a dialog is opened, the main window doesn't get the focus but the toolbar. To reproduce, do following: 1. Open gftp (2.0.17) 2. Drag the || (left) at the toolbar to make it floating. 3. Focus the main window. 4. Help -> About 5. Close 6. Type a few characters, you'll see that the input focus is at the "Host" field. Or: 1. Open Konqueror (KDE 3.2.2) 2. Double click the || (left) at the toolbar to make it floating. 3. Focus the main window. 4. Help -> About KDE 5. Close 6. You'll see optically that the focus is at the toolbar. One solution could be to exclude _NET_WM_WINDOW_TYPE_TOOLBAR from getting automatically the focus if another window is closed. Consider also _NET_WM_WINDOW_TYPE_MENU and even _NET_WM_WINDOW_TYPE_UTILITY.
Thanks, I'll look into it.
The gftp problem is from gftp, it's not a bug with xfwm4. It shows in metacity too.
Not here, maybe you use another version or configuration. What's about Qt dockbars? AFAIK there are no general Gtk+ dockbars, are they? But Anjuta shows the same problem, maybe you can test it in Metacity, too, if you have Anjuta installed.
- I've tested with metacity 2.8.0 from GNOME 2.6 - There is no way to identify those toolbars are they are not using the NET_WM type field (ie the proposed solution will have no effect at all) One solution is to send focus back to the previous focused window (this was the original solution that was implemented in xfce 4.0.0 but reverted later because of the OpenOffice bug)
Also not that the bug might in gtk itself too, as it seems the app just set the gtk_widget grab_default on the text field widget (the one that gets the focus). gtk_widget_grab_default causes widget to become the default widget. widget must have the GTK_CAN_DEFAULT flag set; typically you have to set this flag yourself by calling GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT). The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, gtk_widget_activate() should affect them.
Qt sets _NET_WM_WINDOW_TYPE_TOOLBAR, so there would be a possiblity to identify at least the Qt toolbars (and _NET_WM_WINDOW_TYPE_TOOLBAR is freedesktop.org standard).
If you are using xfce from CVS head, you may want to try this version: http://www.xfce.org/archive/test/xfwm4-4.1.4-cvs.tar.gz I see no problem with anjuta btw.
And if you use xfce stable branch (4.0), you may want to try this one: http://www.xfce.org/archive/test/xfwm4-4.0.6-cvs.tar.gz It also has the same change backported.
Great, this version fixes the problems in Anjuta, and Qt.
Fix + confirmation