[beryl-commits] r4224 - trunk/beryl-core/src
wereHamster at server.beryl-project.org
wereHamster at server.beryl-project.org
Thu Feb 22 16:07:06 CET 2007
Author: wereHamster
Date: 2007-02-22 16:07:06 +0100 (Thu, 22 Feb 2007)
New Revision: 4224
Modified:
trunk/beryl-core/src/screen.c
Log:
beryl-core: clean up moveWindowToViewportPosition()
Modified: trunk/beryl-core/src/screen.c
===================================================================
--- trunk/beryl-core/src/screen.c 2007-02-22 11:53:41 UTC (rev 4223)
+++ trunk/beryl-core/src/screen.c 2007-02-22 15:07:06 UTC (rev 4224)
@@ -3348,38 +3348,34 @@
void moveWindowToViewportPosition(CompWindow * w, int x, Bool sync)
{
- int tx, vWidth = w->screen->width * w->screen->hsize;
+ int vWidth = w->screen->width * w->screen->hsize;
+ if (!w->managed)
+ return;
+
+ if (w->type & (CompWindowTypeDesktopMask | CompWindowTypeDockMask))
+ return;
+
+ if (w->state & CompWindowStateStickyMask)
+ return;
+
x += w->screen->x * w->screen->width;
x = MOD(x, vWidth);
- x -= w->screen->x * w->screen->width;
+ x -= w->screen->x * w->screen->width + w->attrib.x;
- tx = x - w->attrib.x;
- if (tx)
+ if (x)
{
- int m, wx;
+ int m = w->attrib.x + x;
- if (!w->managed)
- return;
-
- if (w->type & (CompWindowTypeDesktopMask | CompWindowTypeDockMask))
- return;
-
- if (w->state & CompWindowStateStickyMask)
- return;
-
- m = w->attrib.x + tx;
if (m - w->output.left < w->screen->width - vWidth)
- wx = tx + vWidth;
+ x += vWidth;
else if (m + w->width + w->output.right > vWidth)
- wx = tx - vWidth;
- else
- wx = tx;
+ x -= vWidth;
if (w->saveMask & CWX)
- w->saveWc.x += wx;
+ w->saveWc.x += x;
- moveWindow(w, wx, 0, sync, TRUE);
+ moveWindow(w, x, 0, sync, TRUE);
if (sync)
syncWindowPosition(w);
More information about the commits
mailing list