[fusion-commits] Compiz mirror: Changes to 'master' (b70d5943826780abd294123a7857fca80f963d76)

compiz at server.opencompositing.org compiz at server.opencompositing.org
Sat May 24 14:30:08 CEST 2008


New commits:
commit b70d5943826780abd294123a7857fca80f963d76
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat May 24 14:25:10 2008 +0200

    Optimizations.

commit 891550526becd37ced19e8e9643ae9f1cc794a22
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat May 24 14:13:30 2008 +0200

    Remove useless checks.
    As w->alive is unconditionally set to true when adding windows, it makes no sense to check if it's true.

commit 87d3bc9b0c1a64af9e19ba75466352342b66aee6
Author: Danny Baumann <dannybaumann at web.de>
Date:   Sat May 24 14:11:59 2008 +0200

    Coding style fixes.

commit 20f0cfaae9fec1f4b87692a90e4988599d9551da
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Fri May 23 16:38:53 2008 -0400

    Fix initial map handling of opacity/brightness/saturation Make the handling of properties for opacity, brightness, and saturation consistent between initial map and subsequent updates: honor the properties even when the window has the DOCK type or is override redirrect.
    
    http://bugs.opencompositing.org/show_bug.cgi?id=955


 src/window.c |   87 +++++++++++++++++++++++----------------------------------
 1 files changed, 35 insertions(+), 52 deletions(-)


Modified: compiz/src/window.c
===================================================================
--- compiz/src/window.c
+++ compiz/src/window.c
@@ -1894,6 +1894,7 @@ addWindow (CompScreen *screen,
 {
     CompWindow  *w;
     CompPrivate	*privates;
+    CompDisplay *d = screen->display;
 
     w = (CompWindow *) malloc (sizeof (CompWindow));
     if (!w)
@@ -1979,9 +1980,6 @@ addWindow (CompScreen *screen,
     w->output.top    = 0;
     w->output.bottom = 0;
 
-    w->paint.opacity	= w->opacity    = OPAQUE;
-    w->paint.brightness = w->brightness = 0xffff;
-    w->paint.saturation = w->saturation = COLOR;
     w->paint.xScale	= 1.0f;
     w->paint.yScale	= 1.0f;
     w->paint.xTranslate	= 0.0f;
@@ -2040,7 +2038,7 @@ addWindow (CompScreen *screen,
        window to the window list as we might get configure requests which
        require us to stack other windows relative to it. Setting some default
        values if this is the case. */
-    if (!XGetWindowAttributes (screen->display->display, id, &w->attrib))
+    if (!XGetWindowAttributes (d->display, id, &w->attrib))
 	setDefaultWindowAttributes (&w->attrib);
 
     w->serverWidth	 = w->attrib.width;
@@ -2069,16 +2067,15 @@ addWindow (CompScreen *screen,
 
     w->saveMask = 0;
 
-    XSelectInput (screen->display->display, id,
+    XSelectInput (d->display, id,
 		  PropertyChangeMask |
 		  EnterWindowMask    |
 		  FocusChangeMask);
 
     w->id = id;
 
-    XGrabButton (screen->display->display, AnyButton,
-		 AnyModifier, w->id, TRUE, ButtonPressMask |
-		 ButtonReleaseMask | ButtonMotionMask,
+    XGrabButton (d->display, AnyButton, AnyModifier, w->id, TRUE,
+		 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
 		 GrabModeSync, GrabModeSync, None, None);
 
     w->inputHint = TRUE;
@@ -2088,10 +2085,10 @@ addWindow (CompScreen *screen,
     w->actions   = 0;
     w->protocols = 0;
     w->type      = CompWindowTypeUnknownMask;
-    w->lastPong  = screen->display->lastPing;
+    w->lastPong  = d->lastPing;
 
-    if (screen->display->shapeExtension)
-	XShapeSelectInput (screen->display->display, id, ShapeNotifyMask);
+    if (d->shapeExtension)
+	XShapeSelectInput (d->display, id, ShapeNotifyMask);
 
     insertWindowIntoScreen (screen, w, aboveId);
 
@@ -2111,11 +2108,11 @@ addWindow (CompScreen *screen,
 
 	XUnionRegion (&rect, w->region, w->region);
 
-	w->damage = XDamageCreate (screen->display->display, id,
+	w->damage = XDamageCreate (d->display, id,
 				   XDamageReportRawRectangles);
 
 	/* need to check for DisplayModal state on all windows */
-	w->state = getWindowState (screen->display, w->id);
+	w->state = getWindowState (d, w->id);
 
 	updateWindowClassHints (w);
     }
@@ -2127,8 +2124,8 @@ addWindow (CompScreen *screen,
 
     w->invisible = TRUE;
 
-    w->wmType    = getWindowType (screen->display, w->id);
-    w->protocols = getProtocols (screen->display, w->id);
+    w->wmType    = getWindowType (d, w->id);
+    w->protocols = getProtocols (d, w->id);
 
     if (!w->attrib.override_redirect)
     {
@@ -2143,45 +2140,17 @@ addWindow (CompScreen *screen,
 
 	recalcWindowType (w);
 
-	getMwmHints (screen->display, w->id, &w->mwmFunc, &w->mwmDecor);
+	getMwmHints (d, w->id, &w->mwmFunc, &w->mwmDecor);
 
 	if (!(w->type & (CompWindowTypeDesktopMask | CompWindowTypeDockMask)))
 	{
-	    w->desktop = getWindowProp (screen->display, w->id,
-					screen->display->winDesktopAtom,
+	    w->desktop = getWindowProp (d, w->id, d->winDesktopAtom,
 					w->desktop);
 	    if (w->desktop != 0xffffffff)
 	    {
 		if (w->desktop >= screen->nDesktop)
 		    w->desktop = screen->currentDesktop;
 	    }
-
-	    if (!(w->type & CompWindowTypeDesktopMask))
-		w->opacityPropSet =
-		    readWindowProp32 (screen->display, w->id,
-				      screen->display->winOpacityAtom,
-				      &w->opacity);
-	}
-
-	w->brightness =
-	    getWindowProp32 (screen->display, w->id,
-			     screen->display->winBrightnessAtom,
-			     BRIGHT);
-
-	if (w->alive)
-	{
-	    w->paint.opacity    = w->opacity;
-	    w->paint.brightness = w->brightness;
-	}
-
-	if (screen->canDoSaturated)
-	{
-	    w->saturation =
-		getWindowProp32 (screen->display, w->id,
-				 screen->display->winSaturationAtom,
-				 COLOR);
-	    if (w->alive)
-		w->paint.saturation = w->saturation;
 	}
     }
     else
@@ -2189,6 +2158,22 @@ addWindow (CompScreen *screen,
 	recalcWindowType (w);
     }
 
+    w->opacity = OPAQUE;
+    if (!(w->type & CompWindowTypeDesktopMask))
+	w->opacityPropSet = readWindowProp32 (d, w->id, d->winOpacityAtom,
+					      &w->opacity);
+
+    w->brightness = getWindowProp32 (d, w->id, d->winBrightnessAtom, BRIGHT);
+
+    if (screen->canDoSaturated)
+	w->saturation = getWindowProp32 (d, w->id, d->winSaturationAtom, COLOR);
+    else
+	w->saturation = COLOR;
+	
+    w->paint.opacity    = w->opacity;
+    w->paint.brightness = w->brightness;
+    w->paint.saturation = w->saturation;
+
     if (w->attrib.map_state == IsViewable)
     {
 	w->placed = TRUE;
@@ -2197,7 +2182,7 @@ addWindow (CompScreen *screen,
 	{
 	    w->managed = TRUE;
 
-	    if (getWmState (screen->display, w->id) == IconicState)
+	    if (getWmState (d, w->id) == IconicState)
 	    {
 		if (w->state & CompWindowStateShadedMask)
 		    w->shaded = TRUE;
@@ -2216,9 +2201,7 @@ addWindow (CompScreen *screen,
 		    if (w->desktop != 0xffffffff)
 			w->desktop = screen->currentDesktop;
 
-		    setWindowProp (screen->display, w->id,
-				   screen->display->winDesktopAtom,
-				   w->desktop);
+		    setWindowProp (d, w->id, d->winDesktopAtom, w->desktop);
 		}
 	    }
 	}
@@ -2236,14 +2219,14 @@ addWindow (CompScreen *screen,
 
 	    w->pendingUnmaps++;
 
-	    XUnmapWindow (screen->display->display, w->id);
+	    XUnmapWindow (d->display, w->id);
 
-	    setWindowState (screen->display, w->state, w->id);
+	    setWindowState (d, w->state, w->id);
 	}
     }
     else if (!w->attrib.override_redirect)
     {
-	if (getWmState (screen->display, w->id) == IconicState)
+	if (getWmState (d, w->id) == IconicState)
 	{
 	    w->managed = TRUE;
 	    w->placed  = TRUE;


More information about the commits mailing list