summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 09:10:01 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-14 09:10:01 +0000
commitacde081891d082280424a5189edcc2e24a79022b (patch)
tree6649ef64f0f796f11ac4772c82e4baebfd8ed788
parent711a3adf9c7a016af43268e8da6c31a18a8b8b7a (diff)
downloadmarex-dev-acde081891d082280424a5189edcc2e24a79022b.tar.gz
marex-dev-acde081891d082280424a5189edcc2e24a79022b.tar.bz2
beryl-core: extended saveWindowGeometry so it can accept an XWindowChanges structure for setting the restore geometry
move plugin: use that tile plugin: use that, fixed maximized window restoring git-svn-id: file:///beryl/trunk@4049 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-core/include/beryl.h4
-rw-r--r--beryl-core/src/window.c16
-rw-r--r--beryl-plugins-unsupported/src/tile.c46
-rw-r--r--beryl-plugins/src/move.c2
4 files changed, 28 insertions, 40 deletions
diff --git a/beryl-core/include/beryl.h b/beryl-core/include/beryl.h
index 905693e..a5e6a08 100644
--- a/beryl-core/include/beryl.h
+++ b/beryl-core/include/beryl.h
@@ -26,7 +26,7 @@
#ifndef _BERYL_H
#define _BERYL_H
-#define BERYL_VERSION 53
+#define BERYL_VERSION 54
#define BERYL_ABI_INFO \
BERYL_VERSION, \
@@ -2385,7 +2385,7 @@ void
recalcWindowActions (CompWindow *w);
void
-saveWindowGeometry (CompWindow *w, int mask);
+saveWindowGeometry (CompWindow *w, XWindowChanges *xwc, int mask);
int
restoreWindowGeometry (CompWindow *w, XWindowChanges *xwc, int mask);
diff --git a/beryl-core/src/window.c b/beryl-core/src/window.c
index 40465c3..ba6f08f 100644
--- a/beryl-core/src/window.c
+++ b/beryl-core/src/window.c
@@ -3162,7 +3162,7 @@ static Bool validSiblingBelow(CompWindow * w, CompWindow * sibling)
}
void
-saveWindowGeometry(CompWindow * w, int mask)
+saveWindowGeometry(CompWindow * w, XWindowChanges *xwc, int mask)
{
int m = mask & ~w->saveMask;
@@ -3171,16 +3171,16 @@ saveWindowGeometry(CompWindow * w, int mask)
return;
if (m & CWX)
- w->saveWc.x = w->serverX;
+ w->saveWc.x = (xwc) ? xwc->x : w->serverX;
if (m & CWY)
- w->saveWc.y = w->serverY;
+ w->saveWc.y = (xwc) ? xwc->y : w->serverY;
if (m & CWWidth)
- w->saveWc.width = w->serverWidth;
+ w->saveWc.width = (xwc) ? xwc->width : w->serverWidth;
if (m & CWHeight)
- w->saveWc.height = w->serverHeight;
+ w->saveWc.height = (xwc) ? xwc->height : w->serverHeight;
if (m & CWBorderWidth)
w->saveWc.border_width = w->serverBorderWidth;
@@ -3388,7 +3388,7 @@ addWindowSizeChanges(CompWindow * w,
if (w->type & CompWindowTypeFullscreenMask)
{
- saveWindowGeometry(w, CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
+ saveWindowGeometry(w, NULL, CWX | CWY | CWWidth | CWHeight | CWBorderWidth);
xwc->width = outputRect.width;
xwc->height = outputRect.height;
@@ -3402,7 +3402,7 @@ addWindowSizeChanges(CompWindow * w,
if (w->state & CompWindowStateMaximizedVertMask)
{
- saveWindowGeometry (w, CWY | CWHeight);
+ saveWindowGeometry (w, NULL, CWY | CWHeight);
xwc->height = workArea.height - w->input.top -
w->input.bottom - oldBorderWidth * 2;
@@ -3414,7 +3414,7 @@ addWindowSizeChanges(CompWindow * w,
if (w->state & CompWindowStateMaximizedHorzMask)
{
- saveWindowGeometry (w, CWX | CWWidth);
+ saveWindowGeometry (w, NULL, CWX | CWWidth);
xwc->width = workArea.width -
(w->input.left + w->input.right + oldBorderWidth * 2);
diff --git a/beryl-plugins-unsupported/src/tile.c b/beryl-plugins-unsupported/src/tile.c
index 610f465..ffebbe3 100644
--- a/beryl-plugins-unsupported/src/tile.c
+++ b/beryl-plugins-unsupported/src/tile.c
@@ -839,23 +839,14 @@ static Bool setWindowFutureSize(CompWindow *w)
if((w->state & MAXIMIZE_STATE) && THIS_VIEWPORT(w->screen).currentTileType == none)
{
//save old Geometry for later restore
- XWindowChanges xwcOrig;
- xwcOrig.x = w->serverX;
- xwcOrig.y = w->serverY;
- xwcOrig.width = w->serverWidth;
- xwcOrig.height = w->serverHeight;
-
- w->serverX = x;
- w->serverY = y;
- w->serverWidth = width;
- w->serverHeight = height;
-
- saveWindowGeometry(w, CWX | CWY | CWWidth | CWHeight);
-
- w->serverX = xwcOrig.x;
- w->serverY = xwcOrig.y;
- w->serverWidth = xwcOrig.width;
- w->serverHeight = xwcOrig.height;
+ XWindowChanges xwc;
+
+ xwc.x = x;
+ xwc.y = y;
+ xwc.width = width;
+ xwc.height = height;
+
+ saveWindowGeometry(w, &xwc, CWX | CWY | CWWidth | CWHeight);
}
else
configureXWindow (w, CWHeight | CWWidth | CWY | CWX, &xwc);
@@ -975,30 +966,27 @@ static Bool saveCoords(CompWindow *w)
TILE_WINDOW(w);
// if the window was maximized save "restore data" for later restoring
- if(w->state&MAXIMIZE_STATE)
+ if(w->state & MAXIMIZE_STATE)
{
XWindowChanges xwc;
- int mask;
-
- mask = restoreWindowGeometry(w, &xwc, CWX | CWY | CWWidth | CWHeight);
- if (mask & CWX)
- tw->originalX = xwc.x;
+ if (w->saveMask & CWX)
+ tw->originalX = w->saveWc.x;
else
tw->originalX = w->serverX;
- if (mask & CWY)
- tw->originalY = xwc.y;
+ if (w->saveMask & CWY)
+ tw->originalY = w->saveWc.y;
else
tw->originalY = w->serverY;
- if (mask & CWWidth)
- tw->originalWidth = xwc.width;
+ if (w->saveMask & CWWidth)
+ tw->originalWidth = w->saveWc.width;
else
tw->originalWidth = w->serverWidth;
- if (mask & CWHeight)
- tw->originalHeight = xwc.height;
+ if (w->saveMask & CWHeight)
+ tw->originalHeight = w->saveWc.height;
else
tw->originalHeight = w->serverHeight;
}
diff --git a/beryl-plugins/src/move.c b/beryl-plugins/src/move.c
index 1458871..c598c81 100644
--- a/beryl-plugins/src/move.c
+++ b/beryl-plugins/src/move.c
@@ -453,7 +453,7 @@ static void moveHandleMotionEvent(CompScreen * s, int xRoot, int yRoot)
w->saveWc.x = xRoot - (width >> 1);
w->saveWc.y = yRoot + (w->input.top >> 1);
- saveWindowGeometry(w, 0);
+ saveWindowGeometry(w, NULL, 0);
md->x = md->y = 0;