summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-09-13 09:01:37 +0200
committerDanny Baumann <dannybaumann@web.de>2007-09-13 09:01:37 +0200
commit4bc9aff2182c378632e5d52967cbb60502201365 (patch)
tree9e1a4fd378a224e0274b38e695311eed99945944
parentdb98a00e3c26ac74dd4c6d4293870deb71512404 (diff)
downloadgroup-4bc9aff2182c378632e5d52967cbb60502201365.tar.gz
group-4bc9aff2182c378632e5d52967cbb60502201365.tar.bz2
Synchronize the old and new top tabs on the actual tab change instead of keeping them centered together all the time.
-rw-r--r--group.c31
-rw-r--r--tab.c19
2 files changed, 22 insertions, 28 deletions
diff --git a/group.c b/group.c
index 617479d..47d2cee 100644
--- a/group.c
+++ b/group.c
@@ -1723,32 +1723,12 @@ groupWindowResizeNotify (CompWindow *w,
if (gw->glowQuads)
groupComputeGlowQuads (w, &gs->glowTexture.matrix);
- if (gw->group && gw->group->tabBar)
+ if (gw->group && gw->group->tabBar && IS_TOP_TAB (w, gw->group))
{
- if (IS_TOP_TAB (w, gw->group))
+ if (gw->group->tabBar->state != PaintOff)
{
- int i;
-
- if (gw->group->tabBar->state != PaintOff)
- {
- groupRecalcTabBarPos (gw->group, pointerX,
- WIN_X (w), WIN_X (w) + WIN_WIDTH (w));
- }
-
- /* move the non-top tabs to the new center of the window */
- for (i = 0; i < gw->group->nWins; i++)
- {
- CompWindow *cw = gw->group->windows[i];
- int dx, dy;
-
- if (cw->id == w->id)
- continue;
-
- dx = WIN_CENTER_X (w) - WIN_CENTER_X (cw);
- dy = WIN_CENTER_Y (w) - WIN_CENTER_Y (cw);
-
- groupEnqueueMoveNotify (cw, dx, dy, TRUE, TRUE);
- }
+ groupRecalcTabBarPos (gw->group, pointerX,
+ WIN_X (w), WIN_X (w) + WIN_WIDTH (w));
}
}
}
@@ -1814,8 +1794,7 @@ groupWindowMoveNotify (CompWindow *w,
(gw->group->grabWindow != w->id) ||
!(gw->group->grabMask & CompWindowGrabMoveMask))
{
- if (!gw->group->tabBar)
- return;
+ return;
}
for (i = 0; i < gw->group->nWins; i++)
diff --git a/tab.c b/tab.c
index 1b12e80..651ac6a 100644
--- a/tab.c
+++ b/tab.c
@@ -1545,7 +1545,7 @@ Bool
groupChangeTab (GroupTabBarSlot *topTab,
ChangeTabAnimationDirection direction)
{
- CompWindow *w;
+ CompWindow *w, *oldTopTab;
GroupSelection *group;
if (!topTab)
@@ -1566,6 +1566,8 @@ groupChangeTab (GroupTabBarSlot *topTab,
if (group->changeState != NoTabChange && group->nextTopTab == topTab)
return TRUE;
+ oldTopTab = group->topTab ? group->topTab->window : NULL;
+
if (group->changeState != NoTabChange)
group->nextDirection = direction;
else if (direction == RotateLeft)
@@ -1627,7 +1629,20 @@ groupChangeTab (GroupTabBarSlot *topTab,
if (topTab != group->nextTopTab)
{
groupSetWindowVisibility (w, TRUE);
- syncWindowPosition (w);
+ if (oldTopTab)
+ {
+ int dx, dy;
+
+ GROUP_SCREEN (w->screen);
+
+ dx = WIN_CENTER_X (oldTopTab) - WIN_CENTER_X (w);
+ dy = WIN_CENTER_Y (oldTopTab) - WIN_CENTER_Y (w);
+
+ gs->queued = TRUE;
+ moveWindow (w, dx, dy, FALSE, TRUE);
+ syncWindowPosition (w);
+ gs->queued = FALSE;
+ }
if (HAS_PREV_TOP_WIN (group))
{