summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/thumbnail.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-29 16:52:30 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-29 16:52:30 +0000
commitaeb1c594f379a68697064195b8151b8818dfe524 (patch)
tree4045c6bed3b037be1566c6e5ad42553bf47cc1d2 /beryl-plugins/src/thumbnail.c
parent7b3893256fb32eb610b391dbe17b1b75a8d20029 (diff)
downloadmarex-dev-aeb1c594f379a68697064195b8151b8818dfe524.tar.gz
marex-dev-aeb1c594f379a68697064195b8151b8818dfe524.tar.bz2
beryl-plugins: thumbnail: thumbnails are now also painted transformed
git-svn-id: file:///beryl/trunk@3392 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/thumbnail.c')
-rw-r--r--beryl-plugins/src/thumbnail.c58
1 files changed, 54 insertions, 4 deletions
diff --git a/beryl-plugins/src/thumbnail.c b/beryl-plugins/src/thumbnail.c
index e3a94c5..bb9737c 100644
--- a/beryl-plugins/src/thumbnail.c
+++ b/beryl-plugins/src/thumbnail.c
@@ -163,16 +163,21 @@ typedef struct _ThumbScreen {
DonePaintScreenProc donePaintScreen;
DamageWindowRectProc damageWindowRect;
WindowResizeNotifyProc windowResizeNotify;
+ PaintTransformedScreenProc paintTransformedScreen;
CompWindow *dock;
CompWindow *pointedWin;
Bool showingThumb;
Thumbnail thumb;
Thumbnail oldThumb;
+ Bool painted;
CompTexture glowTexture;
CompTexture windowTexture;
+ int x;
+ int y;
+
CompOption opt[THUMB_SCREEN_OPTION_NUM];
} ThumbScreen;
@@ -1260,6 +1265,11 @@ thumbPaintScreen (CompScreen *s,
THUMB_SCREEN (s);
+ ts->painted = FALSE;
+
+ ts->x = s->x;
+ ts->y = s->y;
+
unsigned int newMask = mask;
if ((ts->oldThumb.opacity > 0.0 && ts->oldThumb.win) ||
@@ -1270,7 +1280,7 @@ thumbPaintScreen (CompScreen *s,
status = (*s->paintScreen) (s, sAttrib, region, output, newMask);
WRAP (ts, s, paintScreen, thumbPaintScreen);
- if (ts->opt[THUMB_SCREEN_OPTION_ALWAYS_TOP].value.b)
+ if (ts->opt[THUMB_SCREEN_OPTION_ALWAYS_TOP].value.b && !ts->painted)
{
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
{
@@ -1291,6 +1301,43 @@ thumbPaintScreen (CompScreen *s,
return status;
}
+static void
+thumbPaintTransformedScreen (CompScreen *s,
+ const ScreenPaintAttrib *sAttrib,
+ Region region,
+ int output,
+ unsigned int mask)
+{
+
+ THUMB_SCREEN (s);
+
+ UNWRAP (ts, s, paintTransformedScreen);
+ (*s->paintTransformedScreen) (s, sAttrib, region, output, mask);
+ WRAP (ts, s, paintTransformedScreen, thumbPaintTransformedScreen);
+
+ if (ts->opt[THUMB_SCREEN_OPTION_ALWAYS_TOP].value.b &&
+ ts->x == s->x && ts->y == s->y)
+ {
+ ts->painted = TRUE;
+ if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
+ {
+ glPushMatrix();
+ (s->applyScreenTransform) (s, sAttrib, output);
+ prepareXCoords(s, output,-sAttrib->zTranslate);
+ thumbPaintThumb(s,&ts->oldThumb);
+ glPopMatrix();
+ }
+ if (ts->thumb.opacity > 0.0 && ts->thumb.win)
+ {
+ glPushMatrix();
+ (s->applyScreenTransform) (s, sAttrib, output);
+ prepareXCoords(s, output,-sAttrib->zTranslate);
+ thumbPaintThumb(s,&ts->thumb);
+ glPopMatrix();
+ }
+ }
+}
+
static Bool
thumbPaintWindow (CompWindow *w,
const WindowPaintAttrib *attrib,
@@ -1306,7 +1353,8 @@ thumbPaintWindow (CompWindow *w,
status = (*s->paintWindow) (w, attrib, region, mask);
WRAP (ts, s, paintWindow, thumbPaintWindow);
- if (!ts->opt[THUMB_SCREEN_OPTION_ALWAYS_TOP].value.b)
+ if (!ts->opt[THUMB_SCREEN_OPTION_ALWAYS_TOP].value.b &&
+ ts->x == s->x && ts->y == s->y)
{
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win &&
ts->oldThumb.dock == w)
@@ -1449,7 +1497,8 @@ thumbInitScreen (CompPlugin *p,
WRAP (ts, s, preparePaintScreen, thumbPreparePaintScreen);
WRAP (ts, s, donePaintScreen, thumbDonePaintScreen);
WRAP (ts, s, paintWindow, thumbPaintWindow);
- WRAP(ts,s,windowResizeNotify, thumbWindowResizeNotify);
+ WRAP (ts,s,windowResizeNotify, thumbWindowResizeNotify);
+ WRAP (ts, s, paintTransformedScreen, thumbPaintTransformedScreen);
ts->dock = NULL;
ts->pointedWin = NULL;
@@ -1487,7 +1536,8 @@ thumbFiniScreen (CompPlugin *p,
UNWRAP (ts, s, preparePaintScreen);
UNWRAP (ts, s, donePaintScreen);
UNWRAP (ts, s, paintWindow);
- UNWRAP(ts,s,windowResizeNotify);
+ UNWRAP (ts,s,windowResizeNotify);
+ UNWRAP (ts, s, paintTransformedScreen);
if (ts->mouseTimeout)
compRemoveTimeout (ts->mouseTimeout);