summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/wobbly.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-16 12:47:43 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-16 12:47:43 +0000
commitd29e69c646fbdcb65c3969070bede3ccaff85787 (patch)
tree7ec62213882711bc8a4f73f95f76bb42935dfaad /beryl-plugins/src/wobbly.c
parent0720df9001825122bbc6d7b379596b3089ebd109 (diff)
downloadmarex-dev-d29e69c646fbdcb65c3969070bede3ccaff85787.tar.gz
marex-dev-d29e69c646fbdcb65c3969070bede3ccaff85787.tar.bz2
wobbly plugin: remove scale applied in the add geometry stage in wobblyDrawWindowTexture instead of wobblyPaintWindow (David Reveman)
git-svn-id: file:///beryl/trunk@1235 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/wobbly.c')
-rw-r--r--beryl-plugins/src/wobbly.c50
1 files changed, 35 insertions, 15 deletions
diff --git a/beryl-plugins/src/wobbly.c b/beryl-plugins/src/wobbly.c
index e217a1a..e3a0695 100644
--- a/beryl-plugins/src/wobbly.c
+++ b/beryl-plugins/src/wobbly.c
@@ -276,6 +276,7 @@ typedef struct _WobblyScreen
DamageWindowRectProc damageWindowRect;
AddWindowGeometryProc addWindowGeometry;
DrawWindowGeometryProc drawWindowGeometry;
+ DrawWindowTextureProc drawWindowTexture;
SetWindowScaleProc setWindowScale;
WindowResizeNotifyProc windowResizeNotify;
@@ -2597,6 +2598,35 @@ wobblyDrawWindowGeometry (CompWindow * w)
}
}
+static void
+wobblyDrawWindowTexture (CompWindow *w,
+ CompTexture *texture,
+ const WindowPaintAttrib *attrib,
+ unsigned int mask)
+{
+ WOBBLY_SCREEN (w->screen);
+ WOBBLY_WINDOW (w);
+
+ if (ww->wobbly)
+ {
+ WindowPaintAttrib wAttrib = *attrib;
+
+ /* remove scale that is applied at the add geometry stage */
+ wAttrib.xScale = attrib->xScale / ww->model->scale.x;
+ wAttrib.yScale = attrib->yScale / ww->model->scale.y;
+
+ UNWRAP (ws, w->screen, drawWindowTexture);
+ (*w->screen->drawWindowTexture) (w, texture, &wAttrib, mask);
+ WRAP (ws, w->screen, drawWindowTexture, wobblyDrawWindowTexture);
+ }
+ else
+ {
+ UNWRAP (ws, w->screen, drawWindowTexture);
+ (*w->screen->drawWindowTexture) (w, texture, attrib, mask);
+ WRAP (ws, w->screen, drawWindowTexture, wobblyDrawWindowTexture);
+ }
+}
+
static Bool
wobblyPaintWindow (CompWindow * w,
const WindowPaintAttrib * attrib,
@@ -2609,26 +2639,14 @@ wobblyPaintWindow (CompWindow * w,
if (ww->wobbly)
{
- WindowPaintAttrib wAttrib = *attrib;
-
if (mask & PAINT_WINDOW_SOLID_MASK)
return FALSE;
mask |= PAINT_WINDOW_TRANSFORMED_MASK;
-
- wAttrib.xScale = 1.0f;
- wAttrib.yScale = 1.0f;
-
- UNWRAP (ws, w->screen, paintWindow);
- status = (*w->screen->paintWindow) (w, &wAttrib, region, mask);
- WRAP (ws, w->screen, paintWindow, wobblyPaintWindow);
- }
- else
- {
- UNWRAP (ws, w->screen, paintWindow);
- status = (*w->screen->paintWindow) (w, attrib, region, mask);
- WRAP (ws, w->screen, paintWindow, wobblyPaintWindow);
}
+ UNWRAP (ws, w->screen, paintWindow);
+ status = (*w->screen->paintWindow) (w, attrib, region, mask);
+ WRAP (ws, w->screen, paintWindow, wobblyPaintWindow);
return status;
}
@@ -3596,6 +3614,7 @@ wobblyInitScreen (CompPlugin * p, CompScreen * s)
WRAP (ws, s, damageWindowRect, wobblyDamageWindowRect);
WRAP (ws, s, addWindowGeometry, wobblyAddWindowGeometry);
WRAP (ws, s, drawWindowGeometry, wobblyDrawWindowGeometry);
+ WRAP (ws, s, drawWindowTexture, wobblyDrawWindowTexture);
WRAP (ws, s, setWindowScale, wobblySetWindowScale);
WRAP (ws, s, windowResizeNotify, wobblyWindowResizeNotify);
WRAP (ws, s, windowMoveNotify, wobblyWindowMoveNotify);
@@ -3624,6 +3643,7 @@ wobblyFiniScreen (CompPlugin * p, CompScreen * s)
UNWRAP (ws, s, damageWindowRect);
UNWRAP (ws, s, addWindowGeometry);
UNWRAP (ws, s, drawWindowGeometry);
+ UNWRAP (ws, s, drawWindowTexture);
UNWRAP (ws, s, setWindowScale);
UNWRAP (ws, s, windowResizeNotify);
UNWRAP (ws, s, windowMoveNotify);