← Back to team overview

compiz team mailing list archive

[Merge] lp:~sil2100/compiz/workaround_770283 into lp:compiz

 

Łukasz Zemczak has proposed merging lp:~sil2100/compiz/workaround_770283 into lp:compiz.

Requested reviews:
  compiz packagers (compiz)

For more details, see:
https://code.launchpad.net/~sil2100/compiz/workaround_770283/+merge/102505

Introduces a workaround for LP: #770283 (see related branch). The patch will be merged upstream partially, with the actual usage of the workaround being added as a distro-patch. But until we have a new compiz tarball, we need to have the whole fix in the tree for an SRU.

After application of this fix, fglrx systems have working decoration updates. Non-fglrx systems have no visible side-effects. Tested on many fglrx systems and a few non-fglrx ones.
-- 
https://code.launchpad.net/~sil2100/compiz/workaround_770283/+merge/102505
Your team compiz packagers is requested to review the proposed merge of lp:~sil2100/compiz/workaround_770283 into lp:compiz.
=== modified file 'debian/changelog'
--- debian/changelog	2012-04-12 07:16:53 +0000
+++ debian/changelog	2012-04-18 12:38:18 +0000
@@ -1,3 +1,11 @@
+compiz (1:0.9.7.6-0ubuntu2) UNRELEASED; urgency=low
+
+  * debian/patches/workaround_770283.patch:
+    - Workaround a problem with fglrx not refreshing window decoration textures
+      on pixmap modification (LP: #770283)
+
+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@xxxxxxxxxxxxx>  Wed, 18 Apr 2012 13:06:05 +0200
+
 compiz (1:0.9.7.6-0ubuntu1) precise; urgency=low
 
   [ Didier Roche ]

=== modified file 'debian/patches/series'
--- debian/patches/series	2012-04-10 09:02:47 +0000
+++ debian/patches/series	2012-04-18 12:38:18 +0000
@@ -2,3 +2,4 @@
 ccp_plugin.patch
 workaround_broken_drivers.patch
 fix_976467.patch
+workaround_770283.patch

=== added file 'debian/patches/workaround_770283.patch'
--- debian/patches/workaround_770283.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/workaround_770283.patch	2012-04-18 12:38:18 +0000
@@ -0,0 +1,123 @@
+--- compiz-0.9.7.6.orig/plugins/decor/src/decor.cpp
++++ compiz-0.9.7.6/plugins/decor/src/decor.cpp
+@@ -317,44 +317,66 @@ DecorTexture::DecorTexture (Pixmap pixma
+     pixmap (pixmap),
+     damage (None)
+ {
++    if (!bindTexture (pixmap))
++	return;
++
++    damage = XDamageCreate (screen->dpy (), pixmap,
++			     XDamageReportRawRectangles);
++}
++
++/*
++ * DecorTexture::~DecorTexture
++ *
++ * Remove damage handle on texture
++ *
++ */
++
++DecorTexture::~DecorTexture ()
++{
++    if (damage)
++	XDamageDestroy (screen->dpy (), damage);
++}
++
++/*
++ * DecorTexture::indTexture
++ *
++ * This function actually takes and binds/rebinds the given Pixmap
++ * to a texture (i.e. calls GLTexture::bindPixmapToTexture)
++ *
++ */
++
++bool
++DecorTexture::bindTexture (Pixmap src)
++{
+     unsigned int width, height, depth, ui;
+     Window	 root;
+     int		 i;
+ 
++    pixmap = src;
++
+     if (!XGetGeometry (screen->dpy (), pixmap, &root,
+ 		       &i, &i, &width, &height, &ui, &depth))
+     {
+-        status = false;
+-	return;
++	status = false;
++	return false;
+     }
+ 
++    // Explicitly clear the texture list before binding/rebinding
++    textures.clear ();
++
+     bindFailed = false;
+     textures = GLTexture::bindPixmapToTexture (pixmap, width, height, depth);
+     if (textures.size () != 1)
+     {
+ 	bindFailed = true;
+-        status = false;
+-	return;
++	status = false;
++	return false;
+     }
+ 
+     if (!DecorScreen::get (screen)->optionGetMipmap ())
+ 	textures[0]->setMipmap (false);
+ 
+-    damage = XDamageCreate (screen->dpy (), pixmap,
+-			     XDamageReportRawRectangles);
+-}
+-
+-/*
+- * DecorTexture::~DecorTexture
+- *
+- * Remove damage handle on texture
+- *
+- */
+-
+-DecorTexture::~DecorTexture ()
+-{
+-    if (damage)
+-	XDamageDestroy (screen->dpy (), damage);
++    return true;
+ }
+ 
+ /*
+@@ -2315,8 +2337,22 @@ DecorScreen::handleEvent (XEvent *event)
+ 			    {
+ 				DECOR_WINDOW (w);
+ 
+-				if (dw->wd && dw->wd->decor->texture == t)
++				if (dw->wd && dw->wd->decor->texture == t) {
++				    /* XXX FIXME: dirty fglrx workaround here! 
++				       (LP #770283) */
++				    /* If the damage is done on decoration, in case
++				       of fglrx we need to rebind the texture to see 
++				       actual Pixmap changes */
++
++				    XGrabServer (screen->dpy ());
++				    XSync (screen->dpy (), false);
++
++				    t->bindTexture (t->pixmap);
++
++				    XUngrabServer (screen->dpy ());
++				    XSync (screen->dpy (), false);
+ 				    dw->cWindow->damageOutputExtents ();
++				}
+ 			    }
+ 			}
+ 			return;
+--- compiz-0.9.7.6.orig/plugins/decor/src/decor.h
++++ compiz-0.9.7.6/plugins/decor/src/decor.h
+@@ -79,6 +79,8 @@ class DecorTexture {
+ 	DecorTexture (Pixmap pixmap);
+ 	~DecorTexture ();
+ 
++	bool bindTexture (Pixmap src);
++
+     public:
+ 	bool            status;
+ 	int             refCount;