While trying to reproduce an error with input handling and 
unredirect fullscreen windows, I noticed the option didn't work at 
all in compiz master.  This patch gets it working again.

Thanks,
-James Jones

nvpublic
From b117578b09cc97ab516affc189015924a5776855 Mon Sep 17 00:00:00 2001
From: James Jones <[EMAIL PROTECTED]>
Date: Mon, 23 Apr 2007 17:59:03 -0700
Subject: [PATCH] Fix unredirect fullscreen windows.

In paint.c!paintScreenRegion():

-Need to subtract window's region from tmpRegion
 before checking if tmpRegion is NULL.

-Don't try to draw the unredirected window, as
 it will be immediately redirected again by
 paint.c!drawWindow()
---
 src/paint.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/paint.c b/src/paint.c
index a486672..9ce076c 100644
--- a/src/paint.c
+++ b/src/paint.c
@@ -160,6 +160,7 @@ paintScreenRegion (CompScreen	       *sc
     CompWindow    *w;
     CompCursor	  *c;
     int		  count, windowMask, backgroundMask;
+    CompWindow	  *fullscreenWindow = NULL;
 
     if (!tmpRegion)
     {
@@ -201,6 +202,8 @@ paintScreenRegion (CompScreen	       *sc
 	if ((*screen->paintWindow) (w, &w->paint, transform, tmpRegion,
 				    PAINT_WINDOW_OCCLUSION_DETECTION_MASK))
 	{
+	    XSubtractRegion (tmpRegion, w->region, tmpRegion);
+
 	    /* unredirect top most fullscreen windows. */
 	    if (count == 0					      &&
 		!REGION_NOT_EMPTY (tmpRegion)			      &&
@@ -208,9 +211,8 @@ paintScreenRegion (CompScreen	       *sc
 		XEqualRegion (w->region, &screen->region))
 	    {
 		unredirectWindow (w);
+		fullscreenWindow = w;
 	    }
-
-	    XSubtractRegion (tmpRegion, w->region, tmpRegion);
 	}
 
 	count++;
@@ -224,6 +226,9 @@ paintScreenRegion (CompScreen	       *sc
 	if (w->destroyed)
 	    continue;
 
+	if (w == fullscreenWindow)
+	    continue;
+
 	if (!w->shaded)
 	{
 	    if (w->attrib.map_state != IsViewable || !w->damaged)
-- 
1.4.2.4

_______________________________________________
compiz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/compiz

Reply via email to