summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/miniview.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-02 22:59:04 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-02 22:59:04 +0000
commit438f4652a670e511d1c7d85ec71bd1a6193727a9 (patch)
treee15bcef789905f7e49ee632b7250d52010a1d21e /beryl-plugins/src/miniview.c
parent3018291249ff575bb939c9757caa88b4a05d8b98 (diff)
downloadmarex-dev-438f4652a670e511d1c7d85ec71bd1a6193727a9.tar.gz
marex-dev-438f4652a670e511d1c7d85ec71bd1a6193727a9.tar.bz2
Animate transition in to expo mode
git-svn-id: file:///beryl/trunk@3591 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/miniview.c')
-rw-r--r--beryl-plugins/src/miniview.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/beryl-plugins/src/miniview.c b/beryl-plugins/src/miniview.c
index 86f51d8..8ed370f 100644
--- a/beryl-plugins/src/miniview.c
+++ b/beryl-plugins/src/miniview.c
@@ -69,6 +69,7 @@ typedef struct _MiniviewScreen
int miniViewport;
int moveStep;
float zCam;
+ float expoCam;
float size;
@@ -151,6 +152,7 @@ static Bool miniviewExpo(CompDisplay *d, CompAction * action, CompActionState st
s = findScreenAtDisplay(d, xid);
MINIVIEW_SCREEN(s);
ms->expoMode = !ms->expoMode;
+ ms->expoCam = 0;
damageScreen(s);
return FALSE;
@@ -252,8 +254,10 @@ static void miniviewPaintTransformedScreen(CompScreen * s,
glPushMatrix();
//int origView = s->x;
//moveScreenViewport(s,-s->x,0,FALSE);
+ if (ms->expoCam+0.05 <= 1)
+ ms->expoCam += 0.05;
- glScalef(1.0f,1.0f,(float)s->hsize/2.0f);
+ glScalef(1.0f,1.0f,((float)s->hsize/2.0f)*ms->expoCam);
glTranslatef(-1.10f,0.0f,-0.8f);
@@ -280,7 +284,7 @@ static void miniviewDonePaintScreen(CompScreen * s)
{
MINIVIEW_SCREEN(s);
- if (ms->showing)
+ if (ms->showing || ms->expoCam < 1)
damageScreen(s);
@@ -442,7 +446,7 @@ static Bool miniviewInitScreen(CompPlugin * p, CompScreen * s)
if (!ms)
return FALSE;
- ms->expoMode = ms->moving = ms->miniX = ms->miniY = ms->miniViewport = ms->showing = ms->zCam =
+ ms->expoCam = ms->expoMode = ms->moving = ms->miniX = ms->miniY = ms->miniViewport = ms->showing = ms->zCam =
ms->moveStep = 0;
ms->size = 3.0;
addScreenAction(s, &md->opt[MINIVIEW_DISPLAY_OPTION_CREATE].value.action);