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 335351 - Support sibling from restacking ConfigureRequests
Support sibling from restacking ConfigureRequests
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other All
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2006-03-21 12:48 UTC by Pierre Ossman
Modified: 2011-01-19 14:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
_NET_RESTACK_WINDOW and sibling-relative stacking (8.69 KB, patch)
2007-11-08 00:41 UTC, Christian Hammond
committed Details | Review

Description Pierre Ossman 2006-03-21 12:48:52 UTC
Please describe the problem:
From window.c:

  /* Handle stacking. We only handle raises/lowers, mostly because
   * stack.c really can't deal with anything else.  I guess we'll fix
   * that if a client turns up that really requires it.

If someone has the time I'd really like this feature. :)

I know well behaved applications aren't supposed to fiddle with stacking order,
but this is a bit different. What I'm doing is seamless windows support for
rdesktop and as part of this there will be restacking events from the other end.
Currently, if I ask metacity to place window A behind B, then it gets moved to
the very back of the z order. Very annoying. :/

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Elijah Newren 2006-03-22 16:37:54 UTC
Yeah, it'd be good to have this implemented for completeness; there's a FIXME-like comment in metacity/src/window.c about this:
   * I'm pretty sure no interesting client uses TopIf, BottomIf, or
   * Opposite anyway, so the only possible missing thing is
   * Above/Below with a sibling set. For now we just pretend there's
   * never a sibling set and always do the full raise/lower instead of
   * the raise-just-above/below-sibling.
So obviously, it's time to do the sibling thing (i.e. honor event->xconfigurerequest.above).  Shouldn't be too hard.  We have very similar code in meta_window_stack_just_below() that could be useful; also the part of bug 150615 comment 7 about stacking should help out as well.
Comment 2 Thomas Andersen 2006-06-11 02:37:29 UTC
I would like to fix this but I am not so sure about the right way of doing it. This is how I imagine it might be supposed to be done:

switch (event->xconfigurerequest.detail)
  {
    case Above:
      if (event->xconfigurerequest.value_mask & CWSibling)
        {
          MetaWindow *sibling = event->xconfigrequest.above;
          meta_window_stack_just_above (window, sibling);
        }
      else
        meta_window_raise (window);
      break;
    case Below:
      if (event->xconfigurerequest.value_mask & CWSibling)
        {
          MetaWindow *sibling = event->xconfigrequest.above;
          meta_window_stack_just_below (window, sibling);
        }
      else
        meta_window_lower (window);
      break;
    case ...
         ...
  }


And then of cause add meta_window_stack_just_above().

This may be very wrong as I am just starting to understand metacity (and window managers in general even) And to be honest I'm not even sure where event->xconfigrequest.above and .value_mask gets set. But I assume these are given from the client? But how would it know the pointer to the sibling???
Comment 3 Christian Hammond 2007-11-08 00:41:21 UTC
Created attachment 98749 [details] [review]
_NET_RESTACK_WINDOW and sibling-relative stacking

I've needed this for a project I'm working on, so I added support for both sibling-relative restacking and proper support for the _NET_RESTACK_WINDOW hint (which, according to the EMWH spec, allows windows to be stacked in the order given by the calling application without the restrictions given in XConfigureWindow, intended for pagers).

This is my first patch for Metacity but I tried to keep the code style consistent with the rest of the codebase.

I've been using this successfully in my project. I've written a test case (which I'm slowly developing to allow for easily testing what features window managers support), available via SVN at:

https://view.svn.sourceforge.net/svnroot/view/trunk/wm-test-suite/
Comment 4 Thomas Thurman 2011-01-19 14:09:52 UTC
Review of attachment 98749 [details] [review]:

I really have to apologise for leaving this bug untouched for so long. Serves me right that I had a lot of working around code rot to do.

The patch seems fine, it adds something we need to support, and it all appears to work. Nice work on getting our coding style. Nicer on including a test case.

Checked into master.
Comment 5 Thomas Thurman 2011-01-19 14:10:15 UTC
FIXED.