Bug 526045

Summary: Disabling "raise_on_click" prevents windows from changing stacking order
Product: Red Hat Enterprise Linux 5 Reporter: Olivier Fourdan <ofourdan>
Component: metacityAssignee: Owen Taylor <otaylor>
Status: CLOSED ERRATA QA Contact: desktop-bugs <desktop-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.4CC: astokes, kem, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:25:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Olivier Fourdan 2009-09-28 13:49:17 UTC
Created attachment 362895 [details]
Proposed patch

Description of problem:

The option "raise_on_click", when disabled, prevents applications from changing the stacking order.

While this behavior may be in line with the description of the option in GConf, it does not sound right to correlate this option (wich is for user clicks) with intercepting XConfigureRequest() from the application.

Many legacy applications still use XRaiseWindow() or XConfigureWindow() to raise their windows and this should work unless "disable_workarrouds" is set (independently of "raise_on_click")

Version-Release number of selected component (if applicable):

metacity 2.16 (but also in current upstream)

How reproducible:

100% reproducible

Steps to Reproduce:
1. In Red Hat Enterprise Linux 5, run gconf-editor and unselect "raise_on_click" and set focus to "mouse" or "sloppy"

2. Run Thunderbird and open the the address book (control + 2)
3. Raise and focus the main window, keeping the addressbook window open but lowered and unfocused
4. Reopen the address book (either from menu "tools" -> "Address book" or with the shortcut "ctrl+2")
  
Actual results:

The addressbook is not raise and not focused

Expected results:

The addressbook is raised, maybe focused if the pointer is within the window.

Additional info:

In meta_window_configure_request() from src/window.c, if raise_on_click is not set, the request is ignored unconditionally:

meta_window_configure_request()
{
  [...]
  if (event->xconfigurerequest.value_mask & CWStackMode)
    {
      MetaWindow *active_window;
      active_window = window->display->expected_focus_window;
      if (meta_prefs_get_disable_workarounds () ||
          !meta_prefs_get_raise_on_click ())

        {
          meta_topic (META_DEBUG_STACK,
                      "%s sent an xconfigure stacking request; this is "
                      "broken behavior and the request is being ignored.\n",
                      window->desc);
        }
  [...]

This is not the same as bug 503522 (and actually prevent any fix for bug 503522 to work if raise_on_click is unset)

The attached patch from out customer removes that test for !meta_prefs_get_raise_on_click () so that the behavior is consistent even if raise_on_click is unset.

Please also not that the reproducer is with Thunderbird, although recent version of Thunderbird now rightfully use net_window_activate, but many legacy application (not EWMH compliant) are impacted by this issue.

Comment 1 Owen Taylor 2009-09-28 20:26:21 UTC
I can't see any reason for the test being there in the first place; I'm pretty sure we can get this upstream, if not I'm OK carrying a non-upstream patch.

Comment 2 Owen Taylor 2009-10-19 20:54:36 UTC
*** Bug 512163 has been marked as a duplicate of this bug. ***

Comment 3 Owen Taylor 2009-11-11 20:56:42 UTC
built in dist-5E-qu-candidate as metacity-2.16.0-15.el5

Comment 7 errata-xmlrpc 2010-03-30 08:25:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0245.html