Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2007 11:53:07 -0400 (EDT)
From:      Robert Noland <rnoland@2hip.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/115902: [MAINTAINER] x11-wm/compiz-fusion-plugins-extra: Pull patches from git to fix widget plugin
Message-ID:  <200708281553.l7SFr7Lv055721@rnoland-ibm.acs.internap.com>
Resent-Message-ID: <200708281600.l7SG089G064234@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         115902
>Category:       ports
>Synopsis:       [MAINTAINER] x11-wm/compiz-fusion-plugins-extra: Pull patches from git to fix widget plugin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 28 16:00:07 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Robert Noland
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD rnoland-ibm.2hip.net 7.0-CURRENT FreeBSD 7.0-CURRENT #105: Mon Jul 30 17:10:59 EDT 2007
>Description:
Pull in patches from git repo to fix the widget plugin.  This allows
screenlets to function correctly.  Sorry, no screenlets yet.

robert.

Added file(s):
- files/patch-metadata-widget.xml.in
- files/patch-src-widget-widget.c

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- compiz-fusion-plugins-extra-0.5.2_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/x11-wm/compiz-fusion-plugins-extra/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	23 Aug 2007 17:49:12 -0000	1.3
+++ Makefile	28 Aug 2007 15:49:53 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	compiz-fusion-plugins-extra
 PORTVERSION=	0.5.2
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11-wm
 MASTER_SITES=	http://releases.compiz-fusion.org/${PORTVERSION}/
 
Index: files/patch-metadata-widget.xml.in
===================================================================
RCS file: files/patch-metadata-widget.xml.in
diff -N files/patch-metadata-widget.xml.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-metadata-widget.xml.in	28 Aug 2007 15:49:53 -0000
@@ -0,0 +1,10 @@
+--- metadata/widget.xml.in.orig	2007-08-13 08:12:47.000000000 -0400
++++ metadata/widget.xml.in	2007-08-24 17:56:48.000000000 -0400
+@@ -6,6 +6,7 @@
+ 		<deps>
+ 			<relation type="before">
+ 				<plugin>fade</plugin>
++				<plugin>animation</plugin>
+ 			</relation>
+ 		</deps>
+ 		<display>
Index: files/patch-src-widget-widget.c
===================================================================
RCS file: files/patch-src-widget-widget.c
diff -N files/patch-src-widget-widget.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src-widget-widget.c	28 Aug 2007 15:49:53 -0000
@@ -0,0 +1,288 @@
+--- src/widget/widget.c.orig	2007-08-24 18:24:42.000000000 -0400
++++ src/widget/widget.c	2007-08-24 18:25:02.000000000 -0400
+@@ -68,7 +68,6 @@
+     PreparePaintScreenProc preparePaintScreen;
+     DonePaintScreenProc    donePaintScreen;
+     PaintWindowProc        paintWindow;
+-    WindowAddNotifyProc    windowAddNotify;
+ 
+     WidgetState state;
+ 
+@@ -82,7 +81,9 @@
+ {
+     Bool                isWidget;
+     Bool                wasUnmapped;
++    CompWindow          *parentWidget;
+     CompTimeoutHandle   matchUpdateHandle;
++    CompTimeoutHandle   inferiorUpdateHandle;
+     WidgetPropertyState propertyState;
+ } WidgetWindow;
+ 
+@@ -106,6 +107,41 @@
+ 		       GET_WIDGET_SCREEN  (w->screen,            \
+ 		       GET_WIDGET_DISPLAY (w->screen->display)))
+ 
++static void
++widgetUpdateTreeStatus (CompWindow *w)
++{
++    CompWindow   *p;
++    WidgetWindow *pww;
++
++    WIDGET_SCREEN (w->screen);
++
++    /* first clear out every reference to our window */
++    for (p = w->screen->windows; p; p = p->next)
++    {
++	pww = GET_WIDGET_WINDOW (p, ws);
++	if (pww->parentWidget == w)
++	    pww->parentWidget = NULL;
++    }
++
++    for (p = w->screen->windows; p; p = p->next)
++    {
++	Window clientLeader;
++
++	if (p->attrib.override_redirect)
++	    clientLeader = getClientLeader (p);
++	else
++	    clientLeader = p->clientLeader;
++
++	if ((clientLeader == w->clientLeader) && (w->id != p->id))
++	{
++	    WIDGET_SCREEN (w->screen);
++
++	    pww = GET_WIDGET_WINDOW (p, ws);
++	    pww->parentWidget = w;
++	}
++    }
++}
++
+ static Bool
+ widgetUpdateWidgetStatus (CompWindow *w)
+ {
+@@ -131,7 +167,7 @@
+     return retval;
+ }
+ 
+-static void
++static Bool
+ widgetUpdateWidgetPropertyState (CompWindow *w)
+ {
+     CompDisplay   *d = w->screen->display;
+@@ -144,7 +180,7 @@
+     WIDGET_WINDOW (w);
+ 
+     result = XGetWindowProperty (d->display, w->id, wd->compizWidgetAtom,
+-				 0, 1L, FALSE, XA_CARDINAL, &retType,
++				 0, 1L, FALSE, AnyPropertyType, &retType,
+ 				 &format, &nitems, &remain, &data);
+ 
+     if (result == Success && nitems && data)
+@@ -159,7 +195,7 @@
+     else
+ 	ww->propertyState = PropertyNotSet;
+ 
+-    widgetUpdateWidgetStatus (w);
++    return widgetUpdateWidgetStatus (w);
+ }
+ 
+ static void
+@@ -271,6 +307,8 @@
+ 		map = !ww->isWidget || (ws->state != StateOff);
+ 		widgetUpdateWidgetMapState (w, map);
+ 
++		widgetUpdateTreeStatus (w);
++
+ 		(*d->matchPropertyChanged) (d, w);
+ 	    }
+     }
+@@ -295,19 +333,13 @@
+ 
+ 	switch (ws->state) {
+ 	case StateOff:
++	case StateFadeOut:
+ 	    widgetSetWidgetLayerMapState (s, TRUE);
+ 	    ws->fadeTime = 1000.0f * widgetGetFadeTime (s);
+ 	    ws->state = StateFadeIn;
+ 	    break;
+-	case StateFadeIn:
+-	    ws->fadeTime = (1000.0f * widgetGetFadeTime (s)) - ws->fadeTime;
+-	    ws->state = StateFadeOut;
+-	    break;
+-	case StateFadeOut:
+-	    ws->fadeTime = (1000.0f * widgetGetFadeTime (s)) - ws->fadeTime;
+-	    ws->state = StateFadeIn;
+-	    break;
+ 	case StateOn:
++	case StateFadeIn:
+ 	    widgetSetWidgetLayerMapState (s, FALSE);
+ 	    ws->fadeTime = 1000.0f * widgetGetFadeTime (s);
+ 	    ws->state = StateFadeOut;
+@@ -345,8 +377,33 @@
+ 	    w = findWindowAtDisplay (d, event->xproperty.window);
+ 	    if (w)
+ 	    {
+-		widgetUpdateWidgetPropertyState (w);
+-		(*d->matchPropertyChanged) (d, w);
++		if (widgetUpdateWidgetPropertyState (w))
++		{
++		    Bool map;
++
++		    WIDGET_SCREEN (w->screen);
++		    WIDGET_WINDOW (w);
++
++		    map = !ww->isWidget || (ws->state != StateOff);
++		    widgetUpdateWidgetMapState (w, map);
++		    widgetUpdateTreeStatus (w);
++		    (*d->matchPropertyChanged) (d, w);
++		}
++	    }
++	}
++	else if (event->xproperty.atom == d->wmClientLeaderAtom)
++	{
++	    CompWindow *w;
++
++	    w = findWindowAtDisplay (d, event->xproperty.window);
++	    if (w)
++	    {
++		WIDGET_WINDOW (w);
++
++		if (ww->isWidget)
++		    widgetUpdateTreeStatus (w);
++		else if (ww->parentWidget)
++		    widgetUpdateTreeStatus (ww->parentWidget);
+ 	    }
+ 	}
+ 	break;
+@@ -368,7 +425,7 @@
+ 		    {
+ 			WIDGET_WINDOW (w);
+ 
+-			if (!ww->isWidget)
++			if (!ww->isWidget && !ww->parentWidget)
+ 			{
+ 			    CompOption o;
+ 
+@@ -409,12 +466,54 @@
+     WIDGET_WINDOW (w);
+ 
+     if (widgetUpdateWidgetStatus (w))
++    {
++	widgetUpdateTreeStatus (w);
+ 	(*w->screen->display->matchPropertyChanged) (w->screen->display, w);
++    }
+ 
+     ww->matchUpdateHandle = 0;
+     return FALSE;
+ }
+ 
++static Bool
++widgetUpdateInferiors (void *closure)
++{
++    CompWindow *w = (CompWindow *) closure;
++    Window     clientLeader;
++
++    WIDGET_WINDOW (w);
++
++    if (w->attrib.override_redirect)
++	clientLeader = getClientLeader (w);
++    else
++	clientLeader = w->clientLeader;
++
++    if (ww->isWidget)
++    {
++	widgetUpdateTreeStatus (w);
++    }
++    else if (clientLeader)
++    {
++	CompWindow *lw;
++
++	lw = findWindowAtScreen (w->screen, clientLeader);
++	if (lw)
++	{
++	    WidgetWindow *lww;
++
++	    WIDGET_SCREEN (w->screen);
++	    lww = GET_WIDGET_WINDOW (lw, ws);
++
++	    if (lww->isWidget)
++		ww->parentWidget = lw;
++	    else if (lww->parentWidget)
++		ww->parentWidget = lww->parentWidget;
++	}
++    }
++
++    ww->inferiorUpdateHandle = 0;
++    return FALSE;
++}
+ 
+ static void
+ widgetMatchPropertyChanged (CompDisplay *d,
+@@ -435,20 +534,6 @@
+     WRAP (wd, d, matchPropertyChanged, widgetMatchPropertyChanged);
+ }
+ 
+-static void
+-widgetWindowAddNotify (CompWindow *w)
+-{
+-    WIDGET_SCREEN (w->screen);
+-    WIDGET_WINDOW (w);
+-
+-    if (ww->isWidget)
+-	widgetUpdateWidgetMapState (w, (ws->state != StateOff));
+-
+-    UNWRAP (ws, w->screen, windowAddNotify);
+-    (*w->screen->windowAddNotify) (w);
+-    WRAP (ws, w->screen, windowAddNotify, widgetWindowAddNotify);
+-}
+-
+ static Bool
+ widgetPaintWindow (CompWindow              *w,
+ 		   const WindowPaintAttrib *attrib,
+@@ -478,7 +563,7 @@
+ 	    fadeProgress = 1.0f - fadeProgress;
+ 	}
+ 
+-	if (!ww->isWidget)
++	if (!ww->isWidget && !ww->parentWidget)
+ 	{
+ 	    float progress;
+ 
+@@ -572,6 +657,7 @@
+ 		    map = !ww->isWidget || (ws->state != StateOff);
+ 		    widgetUpdateWidgetMapState (w, map);
+ 
++		    widgetUpdateTreeStatus (w);
+ 		    (*s->display->matchPropertyChanged) (s->display, w);
+ 		}
+ 	}
+@@ -700,12 +786,18 @@
+         return FALSE;
+ 
+     ww->isWidget = FALSE;
++    ww->parentWidget = NULL;
+     ww->wasUnmapped = FALSE;
+     ww->matchUpdateHandle = 0;
++    ww->inferiorUpdateHandle = 0;
+ 
+     w->privates[ws->windowPrivateIndex].ptr = ww;
+ 
+-    widgetUpdateWidgetPropertyState (w);
++    if (widgetUpdateWidgetPropertyState (w))
++	widgetUpdateWidgetMapState (w, (ws->state != StateOff));
++
++    ww->inferiorUpdateHandle = compAddTimeout (0, widgetUpdateInferiors,
++					       (void *) w);
+ 
+     return TRUE;
+ }
+@@ -722,6 +814,9 @@
+     if (ww->matchUpdateHandle)
+ 	compRemoveTimeout (ww->matchUpdateHandle);
+ 
++    if (ww->inferiorUpdateHandle)
++	compRemoveTimeout (ww->inferiorUpdateHandle);
++
+     free (ww);
+ }
+ 
--- compiz-fusion-plugins-extra-0.5.2_2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708281553.l7SFr7Lv055721>