[PATCH v3 5/7] composite: Add SourceValidate wrapper

ville.syrjala at nokia.com ville.syrjala at nokia.com
Tue Jan 4 07:55:51 PST 2011


From: Ville Syrjälä <ville.syrjala at nokia.com>

When SourceValidate is performed on a window with IncludeInferiors
sub-window mode, force an immediate update of all the automatically
redirected windows, so that the current window contents will be up
to date.

Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
Reviewed-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
---
v3: No changes

 composite/compinit.c |   22 ++++++++++++++++++++++
 composite/compint.h  |    1 +
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/composite/compinit.c b/composite/compinit.c
index b869a97..80b9ddc 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -79,6 +79,7 @@ compCloseScreen (int index, ScreenPtr pScreen)
     pScreen->PositionWindow = cs->PositionWindow;
 
     pScreen->GetImage = cs->GetImage;
+    pScreen->SourceValidate = cs->SourceValidate;
 
     free(cs);
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
@@ -180,6 +181,24 @@ compGetImage (DrawablePtr pDrawable,
     pScreen->GetImage = compGetImage;
 }
 
+static void compSourceValidate(DrawablePtr pDrawable,
+			       int x, int y,
+			       int width, int height,
+			       unsigned int subWindowMode)
+{
+    ScreenPtr pScreen = pDrawable->pScreen;
+    CompScreenPtr cs = GetCompScreen (pScreen);
+
+    pScreen->SourceValidate = cs->SourceValidate;
+    if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors)
+	compScreenUpdate (pScreen);
+    if (pScreen->SourceValidate)
+	(*pScreen->SourceValidate) (pDrawable, x, y, width, height,
+				    subWindowMode);
+    cs->SourceValidate = pScreen->SourceValidate;
+    pScreen->SourceValidate = compSourceValidate;
+}
+
 /*
  * Add alternate visuals -- always expose an ARGB32 and RGB24 visual
  */
@@ -417,6 +436,9 @@ compScreenInit (ScreenPtr pScreen)
     cs->GetImage = pScreen->GetImage;
     pScreen->GetImage = compGetImage;
 
+    cs->SourceValidate = pScreen->SourceValidate;
+    pScreen->SourceValidate = compSourceValidate;
+
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs);
 
     RegisterRealChildHeadProc(CompositeRealChildHead);
diff --git a/composite/compint.h b/composite/compint.h
index bf4b3cc..99d27f6 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -161,6 +161,7 @@ typedef struct _CompScreen {
     CompOverlayClientPtr        pOverlayClients;
     
     GetImageProcPtr		GetImage;
+    SourceValidateProcPtr	SourceValidate;
 } CompScreenRec, *CompScreenPtr;
 
 extern DevPrivateKeyRec CompScreenPrivateKeyRec;
-- 
1.7.2.2



More information about the xorg-devel mailing list