summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2010-02-12 19:35:26 +0100
committerDennis Kasprzyk <onestone@compiz-fusion.org>2010-02-12 19:35:26 +0100
commit8ba719106e44420a39940d12491c49d896f54213 (patch)
tree896cae6042d97291d14928ed21d1108d07acf126
parent2ba0d8b595e3fcc439e5f8f360b3e1ed3ebceccd (diff)
downloadzcomp-8ba719106e44420a39940d12491c49d896f54213.tar.gz
zcomp-8ba719106e44420a39940d12491c49d896f54213.tar.bz2
Place frame windows in correct stacking order.
-rw-r--r--src/window.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 673aafd..92b948f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -5448,9 +5448,9 @@ PrivateWindow::reparent ()
attr.border_pixel = 0;
attr.colormap = attrib.colormap;
- frame = XCreateWindow (dpy, screen->root (), sg.x (), sg.y (),
- sg.width (), sg.height (), 0, attrib.depth,
- InputOutput, attrib.visual, mask, &attr);
+ frame = XCreateWindow (dpy, screen->root (), 0, 0,
+ 1, 1, 0, attrib.depth,
+ InputOutput, attrib.visual, mask, &attr);
wrapper = XCreateWindow (dpy, frame, 0, 0,
sg.width (), sg.height (), 0, attrib.depth,
@@ -5460,6 +5460,10 @@ 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);
@@ -5495,6 +5499,8 @@ PrivateWindow::reparent ()
ExposureMask);
XUngrabServer (dpy);
+
+ XMoveResizeWindow (dpy, frame, sg.x (), sg.y (), sg.width (), sg.height ());
window->windowNotify (CompWindowNotifyReparent);
@@ -5507,6 +5513,7 @@ PrivateWindow::unreparent ()
Display *dpy = screen->dpy ();
XEvent e;
bool alive = true;
+ XWindowChanges xwc;
if (!frame)
return;
@@ -5527,8 +5534,11 @@ PrivateWindow::unreparent ()
XSelectInput (dpy, frame, NoEventMask);
XSelectInput (dpy, id, NoEventMask);
XSelectInput (dpy, screen->root (), NoEventMask);
- XReparentWindow (dpy, id, screen->root (), serverGeometry.x (),
- serverGeometry.y ());
+ XReparentWindow (dpy, id, screen->root (), 0, 0);
+
+ xwc.stack_mode = Below;
+ xwc.sibling = frame;
+ XConfigureWindow (dpy, id, CWSibling | CWStackMode, &xwc);
XUnmapWindow (dpy, frame);
@@ -5550,6 +5560,8 @@ PrivateWindow::unreparent ()
ExposureMask);
XUngrabServer (dpy);
+
+ XMoveWindow (dpy, id, serverGeometry.x (), serverGeometry.y ());
}
XDestroyWindow (dpy, wrapper);