summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-09-11 13:15:05 +0200
committerDanny Baumann <dannybaumann@web.de>2007-09-11 13:15:05 +0200
commit5057292068f524640e24fee7b2f19fdfc37a97e0 (patch)
tree07a8ecbd01779fdf9fbec85289002309538ee4e4
parent72bd1930c3d777d8ba13fd2f5f5b3bef0f1de85d (diff)
downloadgroup-5057292068f524640e24fee7b2f19fdfc37a97e0.tar.gz
group-5057292068f524640e24fee7b2f19fdfc37a97e0.tar.bz2
Fix movement of tabbed windows to other workspaces.
Made the movement dequeueing sync the window position only once per window. If multiple movement requests are enqueued for a window, this significantly reduces processing time.
-rw-r--r--group-internal.h6
-rw-r--r--group.c7
-rw-r--r--queues.c40
3 files changed, 46 insertions, 7 deletions
diff --git a/group-internal.h b/group-internal.h
index ad20e69..8cf49b3 100644
--- a/group-internal.h
+++ b/group-internal.h
@@ -174,6 +174,12 @@ struct _GroupPendingUngrabs {
GroupPendingUngrabs *next;
};
+typedef struct _GroupPendingSyncs GroupPendingSyncs;
+struct _GroupPendingSyncs {
+ CompWindow *w;
+ GroupPendingSyncs *next;
+};
+
/*
* Pointer to display list
*/
diff --git a/group.c b/group.c
index 106b952..bfe3c31 100644
--- a/group.c
+++ b/group.c
@@ -1747,7 +1747,7 @@ groupWindowResizeNotify (CompWindow *w,
dx = WIN_CENTER_X (w) - WIN_CENTER_X (cw);
dy = WIN_CENTER_Y (w) - WIN_CENTER_Y (cw);
- groupEnqueueMoveNotify (cw, dx, dy, TRUE, TRUE);
+ groupEnqueueMoveNotify (cw, dx, dy, TRUE, TRUE);
}
}
}
@@ -1835,12 +1835,9 @@ groupWindowMoveNotify (CompWindow *w,
if (cw->state & MAXIMIZE_STATE)
{
if (viewportChange)
- {
- gw->needsPosSync = TRUE;
groupEnqueueMoveNotify (cw, -dx, -dy, immediate, TRUE);
- }
}
- else if (!viewportChange)
+ else if (!viewportChange || gw->group->tabBar)
{
gw->needsPosSync = TRUE;
groupEnqueueMoveNotify (cw, dx, dy, immediate,
diff --git a/queues.c b/queues.c
index 92e68c8..3313a3c 100644
--- a/queues.c
+++ b/queues.c
@@ -72,10 +72,33 @@ groupEnqueueMoveNotify (CompWindow *w,
}
}
+static void
+groupDequeueSyncs (GroupPendingSyncs *syncs)
+{
+ GroupPendingSyncs *sync;
+
+ while (syncs)
+ {
+ sync = syncs;
+ syncs = sync->next;
+
+ GROUP_WINDOW (sync->w);
+ if (gw->needsPosSync)
+ {
+ syncWindowPosition (sync->w);
+ gw->needsPosSync = FALSE;
+ }
+
+ free (sync);
+ }
+
+}
+
void
groupDequeueMoveNotifies (CompScreen *s)
{
GroupPendingMoves *move;
+ GroupPendingSyncs *syncs = NULL, *sync;
GROUP_SCREEN (s);
@@ -88,11 +111,24 @@ groupDequeueMoveNotifies (CompScreen *s)
moveWindow (move->w, move->dx, move->dy, TRUE, move->immediate);
if (move->sync)
- syncWindowPosition (move->w);
-
+ {
+ sync = malloc (sizeof (GroupPendingSyncs));
+ if (sync)
+ {
+ GROUP_WINDOW (move->w);
+
+ gw->needsPosSync = TRUE;
+ sync->w = move->w;
+ sync->next = syncs;
+ syncs = sync;
+ }
+ }
free (move);
}
+ if (syncs)
+ groupDequeueSyncs (syncs);
+
gs->queued = FALSE;
}