summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/event.cpp20
-rw-r--r--src/window.cpp4
2 files changed, 14 insertions, 10 deletions
diff --git a/src/event.cpp b/src/event.cpp
index ee4ddfd..fb4b592 100644
--- a/src/event.cpp
+++ b/src/event.cpp
@@ -1084,8 +1084,10 @@ CompScreen::handleEvent (XEvent *event)
if (!w->overrideRedirect ())
priv->setWmState (WithdrawnState, w->id ());
- w->priv->placed = false;
+ w->priv->placed = false;
+ w->priv->managed = false;
w->priv->unmanaging = true;
+
if (w->priv->frame)
{
w->priv->unreparent ();
@@ -1397,37 +1399,39 @@ CompScreen::handleEvent (XEvent *event)
unsigned int xwcm = 0;
XWindowChanges xwc;
int gravity;
+ int value_mask;
unsigned int source;
+ gravity = (event->xclient.data.l[0] & 0xFF);
+ value_mask = (event->xclient.data.l[0] & 0xF00) >> 8;
+ source = (event->xclient.data.l[0] & 0xF000) >> 12;
+
memset (&xwc, 0, sizeof (xwc));
- if (event->xclient.data.l[0] & (1 << 8))
+ if (value_mask & CWX)
{
xwcm |= CWX;
xwc.x = event->xclient.data.l[1];
}
- if (event->xclient.data.l[0] & (1 << 9))
+ if (value_mask & CWY)
{
xwcm |= CWY;
xwc.y = event->xclient.data.l[2];
}
- if (event->xclient.data.l[0] & (1 << 10))
+ if (value_mask & CWWidth)
{
xwcm |= CWWidth;
xwc.width = event->xclient.data.l[3];
}
- if (event->xclient.data.l[0] & (1 << 11))
+ if (value_mask & CWHeight)
{
xwcm |= CWHeight;
xwc.height = event->xclient.data.l[4];
}
- gravity = event->xclient.data.l[0] & 0xFF;
- source = (event->xclient.data.l[0] >> 12) & 0xF;
-
w->moveResize (&xwc, xwcm, gravity, source);
}
}
diff --git a/src/window.cpp b/src/window.cpp
index 32dc8b1..ebd5a75 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1345,7 +1345,7 @@ CompWindow::unmap ()
if (priv->unmapRefCnt > 0)
return;
- if (priv->managed && !priv->placed)
+ if (priv->unmanaging)
{
XWindowChanges xwc;
unsigned int xwcm;
@@ -1364,7 +1364,7 @@ CompWindow::unmap ()
if (xwcm)
configureXWindow (xwcm, &xwc);
- priv->managed = false;
+ priv->unmanaging = false;
}
if (priv->struts)