← Back to team overview

compiz team mailing list archive

[Merge] lp:~unity-team/compiz/compiz.fix-for-fglrx-740298 into lp:~unity-team/compiz/trunk

 

David Barth has proposed merging lp:~unity-team/compiz/compiz.fix-for-fglrx-740298 into lp:~unity-team/compiz/trunk.

Requested reviews:
  compiz packagers (compiz)

For more details, see:
https://code.launchpad.net/~unity-team/compiz/compiz.fix-for-fglrx-740298/+merge/55220

Fix to avoid compiz detection by fglrx driver: bug #740298. For historic reasons, if fglrx detects the compiz program, it falls back to "indirect mode" OpenGL.
This fix works in combination with a soon to be released fglrx driver (version latter than 8.84.60).
With this patch, Unity will work on systems with the fglrx driver.


-- 
https://code.launchpad.net/~unity-team/compiz/compiz.fix-for-fglrx-740298/+merge/55220
Your team compiz packagers is requested to review the proposed merge of lp:~unity-team/compiz/compiz.fix-for-fglrx-740298 into lp:~unity-team/compiz/trunk.
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp	2011-02-24 07:52:09 +0000
+++ plugins/opengl/src/screen.cpp	2011-03-28 19:53:26 +0000
@@ -29,6 +29,7 @@
 
 #include <dlfcn.h>
 #include <math.h>
+#include <errno.h>
 
 namespace GL {
     GLXBindTexImageProc      bindTexImage = NULL;
@@ -83,6 +84,15 @@
     PluginClassHandler<GLScreen, CompScreen, COMPIZ_OPENGL_ABI> (s),
     priv (new PrivateGLScreen (this))
 {
+
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+    // Avoid detection of the compiz program by the fglrx driver.
+    // Change program name to work around app detection in fglrx,
+    // which is needed for older versions of compiz but breaks this
+    // version of compiz.
+    program_invocation_short_name[0] = 'C'; // Change lower case C to capital
+#endif
+
     Display		 *dpy = s->dpy ();
     XVisualInfo		 templ;
     XVisualInfo		 *visinfo;
@@ -531,6 +541,12 @@
     if (GL::textureFromPixmap)
 	registerBindPixmap (TfpTexture::bindPixmapToTexture);
 
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+    // Restore program name in program_invocation_short_name.
+    // This was meant to avoid detection of compiz by the fglrx driver
+    // during OpenGL context creation.
+    program_invocation_short_name[0] = 'c';
+#endif
 }
 
 GLScreen::~GLScreen ()


Follow ups