summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-09-11 11:47:28 +0200
committerDanny Baumann <dannybaumann@web.de>2007-09-11 11:47:28 +0200
commit6b42a5a91421c7b29027de21e027040bf6120902 (patch)
treed369046c6ce1dbc0479cb89e144c40c3c7d874a6
parent620a403cfd3fe8b70e1cd291e60fa26f9ba74005 (diff)
downloadgroup-6b42a5a91421c7b29027de21e027040bf6120902.tar.gz
group-6b42a5a91421c7b29027de21e027040bf6120902.tar.bz2
Fix tabbed windows not being centered together when the top tab is moved.
-rw-r--r--group.c97
1 files changed, 51 insertions, 46 deletions
diff --git a/group.c b/group.c
index b54a057..dff0a5a 100644
--- a/group.c
+++ b/group.c
@@ -1765,6 +1765,7 @@ groupWindowMoveNotify (CompWindow *w,
{
CompScreen *s = w->screen;
Bool viewportChange;
+ Bool preventGroupMove;
int i;
GROUP_SCREEN (s);
@@ -1809,11 +1810,15 @@ groupWindowMoveNotify (CompWindow *w,
}
}
- if (!groupGetMoveAll (s) || gd->ignoreMode ||
+ preventGroupMove = gd->ignoreMode && !gw->group->tabBar;
+
+ if (!groupGetMoveAll (s) || preventGroupMove ||
(gw->group->tabbingState != NoTabbing) ||
(gw->group->grabWindow != w->id) ||
!(gw->group->grabMask & CompWindowGrabMoveMask))
+ {
return;
+ }
for (i = 0; i < gw->group->nWins; i++)
{
@@ -1826,6 +1831,9 @@ groupWindowMoveNotify (CompWindow *w,
GROUP_WINDOW (cw);
+ gw->destination.x += dx;
+ gw->destination.y += dy;
+
if (cw->state & MAXIMIZE_STATE)
{
if (viewportChange)
@@ -1928,64 +1936,61 @@ groupWindowUngrabNotify (CompWindow *w)
if (gw->group && !gd->ignoreMode && !gs->queued)
{
- if (!gw->group->tabBar)
- {
- int i;
- XRectangle rect;
+ int i;
+ XRectangle rect;
- groupDequeueMoveNotifies (s);
+ groupDequeueMoveNotifies (s);
- if (gd->resizeInfo)
- {
- rect.x = WIN_X (w);
- rect.y = WIN_Y (w);
- rect.width = WIN_WIDTH (w);
- rect.height = WIN_HEIGHT (w);
- }
+ if (gd->resizeInfo)
+ {
+ rect.x = WIN_X (w);
+ rect.y = WIN_Y (w);
+ rect.width = WIN_WIDTH (w);
+ rect.height = WIN_HEIGHT (w);
+ }
- for (i = 0; i < gw->group->nWins; i++)
+ for (i = 0; i < gw->group->nWins; i++)
+ {
+ CompWindow *cw = gw->group->windows[i];
+ if (!cw)
+ continue;
+
+ if (cw->id != w->id)
{
- CompWindow *cw = gw->group->windows[i];
- if (!cw)
- continue;
+ GROUP_WINDOW (cw);
- if (cw->id != w->id)
+ if (gw->resizeGeometry)
{
- GROUP_WINDOW (cw);
-
- if (gw->resizeGeometry)
- {
- unsigned int mask;
+ unsigned int mask;
- gw->resizeGeometry->x = WIN_X (cw);
- gw->resizeGeometry->y = WIN_Y (cw);
- gw->resizeGeometry->width = WIN_WIDTH (cw);
- gw->resizeGeometry->height = WIN_HEIGHT (cw);
+ gw->resizeGeometry->x = WIN_X (cw);
+ gw->resizeGeometry->y = WIN_Y (cw);
+ gw->resizeGeometry->width = WIN_WIDTH (cw);
+ gw->resizeGeometry->height = WIN_HEIGHT (cw);
- mask = groupUpdateResizeRectangle (cw, &rect, FALSE);
- if (mask)
- {
- XWindowChanges xwc;
- xwc.x = gw->resizeGeometry->x;
- xwc.y = gw->resizeGeometry->y;
- xwc.width = gw->resizeGeometry->width;
- xwc.height = gw->resizeGeometry->height;
+ mask = groupUpdateResizeRectangle (cw, &rect, FALSE);
+ if (mask)
+ {
+ XWindowChanges xwc;
+ xwc.x = gw->resizeGeometry->x;
+ xwc.y = gw->resizeGeometry->y;
+ xwc.width = gw->resizeGeometry->width;
+ xwc.height = gw->resizeGeometry->height;
- configureXWindow (cw, mask, &xwc);
- }
- else
- {
- free (gw->resizeGeometry);
- gw->resizeGeometry = NULL;
- }
+ configureXWindow (cw, mask, &xwc);
}
- if (gw->needsPosSync)
+ else
{
- syncWindowPosition (cw);
- gw->needsPosSync = FALSE;
+ free (gw->resizeGeometry);
+ gw->resizeGeometry = NULL;
}
- groupEnqueueUngrabNotify (cw);
}
+ if (gw->needsPosSync)
+ {
+ syncWindowPosition (cw);
+ gw->needsPosSync = FALSE;
+ }
+ groupEnqueueUngrabNotify (cw);
}
}