summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2011-04-21 09:06:18 +0200
committerDanny Baumann <dannybaumann@web.de>2011-04-21 09:06:18 +0200
commitb030977e788b5c6e57a7dfe4d179e0bfd33bf2d4 (patch)
treec8bd5da52cac317a960c146048e50e5384e8c419
parente113f626b6bf16ddee49523a61894e223d13cbad (diff)
downloadsession-b030977e788b5c6e57a7dfe4d179e0bfd33bf2d4.tar.gz
session-b030977e788b5c6e57a7dfe4d179e0bfd33bf2d4.tar.bz2
Fix windows restoring on wrong viewports.
Most windows are restored via the MapRequest handler and are unmapped at that point. Core's windowOnAllViewports function returned TRUE for those windows, which made us not take the current viewport into consideration.
-rw-r--r--session.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/session.c b/session.c
index 8408992..df66071 100644
--- a/session.c
+++ b/session.c
@@ -335,6 +335,21 @@ sessionGetStringForProp (xmlNodePtr node,
}
static Bool
+sessionWindowIsOnAllViewports (CompWindow *w)
+{
+ /* core's windowOnAllViewports function also returns TRUE for
+ non-viewable windows, which is why we have to duplicate the
+ window type/state check here */
+ if (w->type & (CompWindowTypeDockMask | CompWindowTypeDesktopMask))
+ return TRUE;
+
+ if (w->state & CompWindowStateStickyMask)
+ return TRUE;
+
+ return FALSE;
+}
+
+static Bool
isSessionWindow (CompWindow *w)
{
if (w->attrib.override_redirect)
@@ -427,7 +442,7 @@ sessionAddWindowNode (CompWindow *w,
x = (w->saveMask & CWX) ? w->saveWc.x : w->serverX;
y = (w->saveMask & CWY) ? w->saveWc.y : w->serverY;
- if (!windowOnAllViewports (w))
+ if (!sessionWindowIsOnAllViewports (w))
{
x += w->screen->x * w->screen->width;
y += w->screen->y * w->screen->height;
@@ -643,7 +658,7 @@ sessionReadWindow (CompWindow *w)
xwc.x = cur->geometry.x + w->input.left;
xwc.y = cur->geometry.y + w->input.top;
- if (!windowOnAllViewports (w))
+ if (!sessionWindowIsOnAllViewports (w))
{
xwc.x -= (w->screen->x * w->screen->width);
xwc.y -= (w->screen->y * w->screen->height);