After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559729 - Showing a "utility" or "toolbar" transient window will unfocus ancestor
Showing a "utility" or "toolbar" transient window will unfocus ancestor
Status: RESOLVED DUPLICATE of bug 487356
Product: metacity
Classification: Other
Component: Focus
2.24.x
Other All
: Normal normal
: ---
Assigned To: Thomas Thurman
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2008-11-07 11:32 UTC by Caolan McNamara
Modified: 2008-11-07 15:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
demo (914 bytes, application/x-tar)
2008-11-07 11:32 UTC, Caolan McNamara
Details

Description Caolan McNamara 2008-11-07 11:32:24 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:
Comment 1 Caolan McNamara 2008-11-07 11:32:51 UTC
Created attachment 122177 [details]
demo
Comment 2 Thomas Thurman 2008-11-07 15:02:25 UTC
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 ***