summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@gmail.com>2010-08-10 00:28:54 +0800
committerSam Spilsbury <smspillaz@gmail.com>2010-08-10 00:28:54 +0800
commit95df71e732b00dba9910683804171faa72c38d65 (patch)
treee274860afe507e2a4f2fa1e4a39570300ec4bf49 /src/window.cpp
parent3f25cf03a5954a2ad4413738b4e92b54ae439c4b (diff)
downloadunity-window-decorator-95df71e732b00dba9910683804171faa72c38d65.tar.gz
unity-window-decorator-95df71e732b00dba9910683804171faa72c38d65.tar.bz2
Use anchor stacking point as either directly above or directly below
window when reparenting windows
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/window.cpp b/src/window.cpp
index b986093..468180b 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -5490,6 +5490,8 @@ PrivateWindow::reparent ()
XEvent e;
CompWindow::Geometry sg = serverGeometry;
Display *dpy = screen->dpy ();
+ CompWindow *sibling = window->next ? window->next : window->prev;
+ bool above = window->next ? false : true;
if (frame || attrib.override_redirect)
@@ -5531,11 +5533,6 @@ PrivateWindow::reparent ()
ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
GrabModeSync, GrabModeSync, None, None);
-
- xwc.stack_mode = Below;
- xwc.sibling = id;
- XConfigureWindow (dpy, frame, CWSibling | CWStackMode, &xwc);
-
XMapWindow (dpy, wrapper);
XReparentWindow (dpy, id, wrapper, 0, 0);
@@ -5574,6 +5571,15 @@ PrivateWindow::reparent ()
XMoveResizeWindow (dpy, frame, sg.x (), sg.y (), sg.width (), sg.height ());
+ /* Try to use a relative window as a stacking anchor point */
+ if (sibling)
+ {
+ if (above)
+ window->restackAbove (sibling);
+ else
+ window->restackBelow (sibling);
+ }
+
window->windowNotify (CompWindowNotifyReparent);
return true;