summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 03:15:07 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 03:15:07 +0000
commit9bb41e4c3b74248e19f676e61b3d74d3b91dacb2 (patch)
tree7ecf5e910f51043d8525e323293d1a7498b25fdd
parent2a39839ef138b71e39541c4c98154912e80e140b (diff)
downloadmarex-dev-9bb41e4c3b74248e19f676e61b3d74d3b91dacb2.tar.gz
marex-dev-9bb41e4c3b74248e19f676e61b3d74d3b91dacb2.tar.bz2
Add moveToViewportYPosition function in wall.c...implement move with window, still needs some tweaks
git-svn-id: file:///beryl/trunk@4007 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/wall.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/beryl-plugins/src/wall.c b/beryl-plugins/src/wall.c
index 4da9baf..e447693 100644
--- a/beryl-plugins/src/wall.c
+++ b/beryl-plugins/src/wall.c
@@ -202,6 +202,9 @@ typedef struct _WallScreen
Bool miniScreen;
WindowPaintAttrib mSAttribs;
+
+ int moveWindowX;
+ int moveWindowY;
} WallScreen;
@@ -314,6 +317,8 @@ static void wallMoveViewport(CompScreen * s, int x, int y, Window moveWindow)
if (!(w->state & CompWindowStateStickyMask))
{
ws->moveWindow = w->id;
+ ws->moveWindowX = w->attrib.x;
+ ws->moveWindowY = w->attrib.y;
raiseWindow (w);
}
}
@@ -1096,6 +1101,46 @@ static Bool wallPaintScreen(CompScreen * s,
return status;
}
+static void moveWindowToViewportYPosition(CompWindow * w, int y, Bool sync)
+{
+ int ty, vHeight = w->screen->height * w->screen->hsize;
+
+ y += w->screen->y * w->screen->height;
+ y = MOD(y, vHeight);
+ y -= w->screen->y * w->screen->height;
+
+ ty = y - w->attrib.y;
+ if (ty)
+ {
+ int m, wy;
+
+ if (!w->managed)
+ return;
+
+ if (w->type & (CompWindowTypeDesktopMask | CompWindowTypeDockMask))
+ return;
+
+ if (w->state & CompWindowStateStickyMask)
+ return;
+
+ m = w->attrib.y + ty;
+ if (m - w->output.top < w->screen->height - vHeight)
+ wy = ty + vHeight;
+ else if (m + w->height + w->output.bottom > vHeight)
+ wy = ty - vHeight;
+ else
+ wy = ty;
+
+ if (w->saveMask & CWY)
+ w->saveWc.y += wy;
+
+ moveWindow(w, 0, wy, sync, TRUE);
+
+ if (sync)
+ syncWindowPosition(w);
+ }
+}
+
static void wallPreparePaintScreen(CompScreen * s, int ms)
{
@@ -1147,11 +1192,23 @@ static void wallPreparePaintScreen(CompScreen * s, int ms)
if (ws->moveWindow)
{
CompWindow *w;
+
+ WALL_DISPLAY(s->display);
+
+ double left =
+ (float)ws->timer /
+ (wd->opt[WALL_DISPLAY_OPTION_SLIDE_DURATION].value.f * 1000.0f *
+ MAX(abs(ws->destx), abs(ws->desty)));
+
+ double xt = left*ws->destx*s->width;
+ printf("xt: %f\n",xt);
w = findWindowAtScreen(s, ws->moveWindow);
if (w)
{
- //moveWindow (w, insertX insertY, TRUE, TRUE);
+ //moveWindow (w, -(ws->moveWindowX-w->attrib.x)*ws->destx ,(ws->moveWindowY-w->attrib.y)*ws->desty, TRUE, TRUE);
+ moveWindowToViewportPosition(w,ws->moveWindowX-(1-left)*s->width*ws->destx,FALSE);
+ moveWindowToViewportYPosition(w,ws->moveWindowY-(1-left)*s->height*ws->desty,FALSE);
syncWindowPosition(w);
}
}