[fusion-commits] Metacity like info on resize.: Changes to 'master' (af27d8cc1041b5dd354cc8562c69603d3b864795)
maniac at server.opencompositing.org
maniac at server.opencompositing.org
Tue May 20 18:34:05 CEST 2008
New commits:
commit af27d8cc1041b5dd354cc8562c69603d3b864795
Author: Danny Baumann <dannybaumann at web.de>
Date: Tue May 20 18:33:49 2008 +0200
Improve damage behaviour.
resizeinfo.c | 52 +++++++++++++++++++++++++++++++---------------------
1 files changed, 31 insertions(+), 21 deletions(-)
Modified: fusion/plugins/resizeinfo/resizeinfo.c
===================================================================
--- fusion/plugins/resizeinfo/resizeinfo.c
+++ fusion/plugins/resizeinfo/resizeinfo.c
@@ -316,6 +316,33 @@ gradientChanged (CompDisplay *d,
drawCairoBackground (s);
}
+static void
+damagePaintRegion (CompScreen *s)
+{
+ REGION reg;
+ int x, y;
+
+ INFO_SCREEN (s);
+
+ if (!is->fadeTime && !is->drawing)
+ return;
+
+ x = is->resizeGeometry.x + is->resizeGeometry.width / 2.0f -
+ RESIZE_POPUP_WIDTH / 2.0f;
+ y = is->resizeGeometry.y + is->resizeGeometry.height / 2.0f -
+ RESIZE_POPUP_HEIGHT / 2.0f;
+
+ reg.rects = ®.extents;
+ reg.numRects = 1;
+
+ reg.extents.x1 = x - 5;
+ reg.extents.y1 = y - 5;
+ reg.extents.x2 = x + RESIZE_POPUP_WIDTH + 5;
+ reg.extents.y2 = y + RESIZE_POPUP_HEIGHT + 5;
+
+ damageScreenRegion (s, ®);
+}
+
/* Handle the fade in /fade out. */
static void
infoPreparePaintScreen (CompScreen *s,
@@ -329,7 +356,7 @@ infoPreparePaintScreen (CompScreen *s,
if (is->fadeTime < 0)
is->fadeTime = 0;
}
-
+
UNWRAP (is, s, preparePaintScreen);
(*s->preparePaintScreen) (s, ms);
WRAP (is, s, preparePaintScreen, infoPreparePaintScreen);
@@ -342,26 +369,8 @@ infoDonePaintScreen (CompScreen *s)
if (is->pWindow)
{
- if (is->fadeTime || is->drawing)
- {
- REGION reg;
- int x, y;
-
- x = is->resizeGeometry.x + is->resizeGeometry.width / 2.0f -
- RESIZE_POPUP_WIDTH / 2.0f;
- y = is->resizeGeometry.y + is->resizeGeometry.height / 2.0f -
- RESIZE_POPUP_HEIGHT / 2.0f;
-
- reg.rects = ®.extents;
- reg.numRects = 1;
-
- reg.extents.x1 = x - 5;
- reg.extents.y1 = y - 5;
- reg.extents.x2 = x + RESIZE_POPUP_WIDTH + 5;
- reg.extents.y2 = y + RESIZE_POPUP_HEIGHT + 5;
-
- damageScreenRegion (s, ®);
- }
+ if (is->fadeTime)
+ damagePaintRegion (s);
if (!is->fadeTime && !is->drawing)
is->pWindow = 0;
@@ -550,6 +559,7 @@ infoHandleEvent (CompDisplay *d,
is->resizeGeometry.height = event->xclient.data.l[3];
updateTextLayer (w->screen);
+ damagePaintRegion (w->screen);
}
}
}
More information about the commits
mailing list