GNOME Bugzilla – Bug 559729
Showing a "utility" or "toolbar" transient window will unfocus ancestor
Last modified: 2008-11-07 15:02:25 UTC
Please describe the problem: Attached is a pygtk example of something which affects OpenOffice.org The real-world examples are a context sensitive toolbar which appears when the cursor is inside a table and disappears when it leaves the table. The other is a utility window which displays available styles. In both cases the windows don't have focus on map and don't accept focus and are transients of the main window What happens is that when the utility or toolbar windows are mapped then in metacity we fall into the code of... if ( focus_window != NULL && window->showing_for_first_time && ( (!place_on_top_on_map && !takes_focus_on_map) || window_would_be_covered (window) ) ) { if (meta_window_is_ancestor_of_transient (focus_window, window)) { /* This happens for error dialogs or alerts; these need to remain on * top, but it would be confusing to have its ancestor remain * focused. */ meta_topic (META_DEBUG_STARTUP, "The focus window %s is an ancestor of the newly mapped " "window %s which isn't being focused. Unfocusing the " "ancestor.\n", focus_window->desc, window->desc); meta_display_focus_the_no_focus_window (window->display, window->screen, timestamp); Where place_on_top_on_map and takes_focus_on_map are false. The comments seem to suggest that the intent is to force error dialogs and alerts to remain on top if they have been mapped for some reason. Perhaps the case of utility and toolbar windows should be explictly added to avoid going through this focus-nothing mechanism. FWIW compiz doesn't do the same thing. Under compiz it "works" the way I'd expect Steps to reproduce: untar the attached test-case and run python ./utilitydemo.py click on the toggle Actual results: The utility window should appear and the main window will lose focus Expected results: As under compiz the utility window should appear but the main window should retain focus Does this happen every time? Yup Other information:
Created attachment 122177 [details] demo
This bug is a major nuisance and I think I will up its priority. Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 487356 ***