GNOME Bugzilla – Bug 525774
_NET_WM_WINDOW_TYPE_UTILITY type windows don't take input focus when mapped
Last modified: 2010-01-21 07:28:25 UTC
Please describe the problem: I'm running Ubuntu 7.04 with Metacity 2.18.2. Metacity sources (src/window.c, window_state_on_map()) indicate that utility and toolbar windows don't take focus on map. http://live.gnome.org/Metacity/WindowTypes says that Utility type is "Appropriate for toolboxes, formatting palettes, and Find/Change windows". Since it mentions "Find/Change windows", does that mean that in order to start typing a user has to click on a window first? (I'm a Wine developer, and Wine makes windows with WS_EX_TOOLWINDOW style set have an utility type. That leads to quite a bit of trouble and user confusion due to the behaviour described above.) Steps to reproduce: Actual results: Expected results: Does this happen every time? Yes. Other information:
Metacity's support for utility windows is somewhat lacking...at least partially due to lack of number of applications using them. The wiki page you point to was some suggestions by a member of the usability team (mpt); I can't remember all the details, but I do remember there being some good ideas that we simply haven't had time to implement. However, the suggestion to use utility windows for find/change windows seems a bit odd to me...maybe I just need to re-read the page but traditionally people have just made those dialogs. For best compatibility with what is currently implemented, I'd suggest making find/change windows dialogs for now.
The purpose of this bug report to clarify whether there are some reasons behind the described behaviour, but if there is no really one, then please consider changing the Metacity to make utility windows have keyboard input focus after mapping. Just for your information, KDE's WM doesn't have this bug.
Created attachment 110211 [details] [review] Allow utility windows to take focus on map Attached patch should fix this problem. Also, the same thing should be done for META_WINDOW_MENU, otherwise I don't see how keyboard navigation in menus supposed to work.
Can somebody from the Metacity team comment on this bug please?
The original idea of utility windows was for the little tool palette windows that you see on mac, with the small titlebar and (not sure about this) maybe they vanish when the application is not focused. But definitely it's for always-open windows like Photoshop toolbox, not for open-quickly-then-close windows like a find dialog. I think it is a fair statement that these window types are not really tested or adequately thought through at this point, so probably should not be used except by people willing to sort of define the style guide as they go and patch the WM and specs accordingly. I have no idea, personally, how keynav and focus would be intended to work on these, but offhand I'd guess what you want with say the Photoshop toolbox is that it never gets focused, in particular not when you click on it, though there might be some obscure way to focus it (sort of like how F10 focuses the menubar) If you can point to some docs on WS_EX_TOOLWINDOW people might venture an opinion on whether that style would be the same as the mac-type toolbox windows. But basically the only apps that really could/would use this window type (gimp, inkscape type of stuff) do not use it. So it's sort of vestigial.
Review of attachment 110211 [details] [review]: Marking reviewed per Havoc's comments.
Marking INVALID per Havoc's comments. Reporter, feel free to reopen if you disagree and have reasons.
I don't see how Havoc's comments make this bug invalid. Current utility windows behaviour neither match the documented nor logically expected one. You either need to fix documentation/better describe what's expected from utility windows or change Metacity to comply with docs. See the original report for reasons. I'm not insisting though, so if you prefer to have utility windows support kind of broken/inconsistent, or just not willing to do anything - feel free to ignore this report.