summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 07:44:39 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-16 07:44:39 +0000
commitbfb2f57ed827a601f65350cc4b69f80624a58025 (patch)
tree694171f487637118eddcd46bd1b724430b58f1ad
parentdd9a341a8309bc26d65f1075ee152de35fee2c8c (diff)
downloadmarex-dev-bfb2f57ed827a601f65350cc4b69f80624a58025.tar.gz
marex-dev-bfb2f57ed827a601f65350cc4b69f80624a58025.tar.bz2
wall plugin: be a bit more efficient with screen redraws in expo mode
git-svn-id: file:///beryl/trunk@4092 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r--beryl-plugins/src/wall.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/beryl-plugins/src/wall.c b/beryl-plugins/src/wall.c
index a74feff..10c9ff9 100644
--- a/beryl-plugins/src/wall.c
+++ b/beryl-plugins/src/wall.c
@@ -175,6 +175,7 @@ typedef struct _WallScreen
PreparePaintScreenProc preparePaintScreen;
PaintTransformedScreenProc paintTransformedScreen;
DrawWindowProc drawWindow;
+ DamageWindowRectProc damageWindowRect;
WindowGrabNotifyProc windowGrabNotify;
WindowUngrabNotifyProc windowUngrabNotify;
@@ -856,6 +857,22 @@ static void wallWindowGrabNotify(CompWindow * w,
WRAP(ws, w->screen, windowGrabNotify, wallWindowGrabNotify);
}
+static Bool wallDamageWindowRect(CompWindow *w, Bool initial, BoxPtr rect)
+{
+ WALL_SCREEN(w->screen);
+ Bool status;
+
+ UNWRAP(ws, w->screen, damageWindowRect);
+ status = (*w->screen->damageWindowRect) (w, initial, rect);
+ WRAP(ws, w->screen, damageWindowRect, wallDamageWindowRect);
+
+ if (ws->expoCam > 0.0f)
+ damageScreen(w->screen);
+
+ return status;
+}
+
+
static Bool wallPaintScreen(CompScreen * s,
const ScreenPaintAttrib * sAttrib,
const CompTransform *transform,
@@ -1683,7 +1700,7 @@ static void wallDonePaintScreen(CompScreen * s)
{
WALL_SCREEN(s);
- if (ws->expoCam > 0.0 || ws->moving || ws->boxTimeout)
+ if (ws->moving || ws->boxTimeout || (ws->expoCam > 0.0f && ws->expoCam < 1.0f))
damageScreen(s);
if (ws->boxTimeout < 0)
@@ -2221,6 +2238,7 @@ static Bool wallInitScreen(CompPlugin * p, CompScreen * s)
WRAP(ws, s, drawWindow, wallDrawWindow);
WRAP(ws, s, windowGrabNotify, wallWindowGrabNotify);
WRAP(ws, s, windowUngrabNotify, wallWindowUngrabNotify);
+ WRAP(ws, s, damageWindowRect, wallDamageWindowRect);
s->privates[wd->screenPrivateIndex].ptr = ws;
@@ -2243,6 +2261,7 @@ static void wallFiniScreen(CompPlugin * p, CompScreen * s)
UNWRAP(ws, s, drawWindow);
UNWRAP(ws, s, windowGrabNotify);
UNWRAP(ws, s, windowUngrabNotify);
+ UNWRAP(ws, s, damageWindowRect);
free(ws);
}