Merge lp:~compiz-team/compiz-workarounds-plugin/compiz-workarounds-plugin.fix_874933 into lp:compiz-workarounds-plugin

Proposed by Sam Spilsbury
Status: Merged
Merge reported by: Sam Spilsbury
Merged at revision: not available
Proposed branch: lp:~compiz-team/compiz-workarounds-plugin/compiz-workarounds-plugin.fix_874933
Merge into: lp:compiz-workarounds-plugin
Diff against target: 88 lines (+42/-0)
3 files modified
src/workarounds.cpp (+34/-0)
src/workarounds.h (+3/-0)
workarounds.xml.in (+5/-0)
To merge this branch: bzr merge lp:~compiz-team/compiz-workarounds-plugin/compiz-workarounds-plugin.fix_874933
Reviewer Review Type Date Requested Status
Robert Carr (community) Approve
Review via email: mp+79468@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote :

A sad +1.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/workarounds.cpp'
2--- src/workarounds.cpp 2011-08-12 06:06:48 +0000
3+++ src/workarounds.cpp 2011-10-27 11:52:23 +0000
4@@ -26,6 +26,12 @@
5
6 #include "workarounds.h"
7
8+#ifndef _GNU_SOURCE
9+#define _GNU_SOURCE
10+#endif
11+
12+#include <errno.h>
13+
14 bool haveOpenGL;
15
16 COMPIZ_PLUGIN_20090315 (workarounds, WorkaroundsPluginVTable);
17@@ -320,6 +326,15 @@
18 cScreen->preparePaintSetEnabled (this, false);
19 }
20
21+ if (haveOpenGL && optionGetWorkaroundGlxCreateContextDetection () && checkScreen)
22+ {
23+ gScreen->glInitContextSetEnabled (this, true);
24+ }
25+ else if (haveOpenGL && checkScreen)
26+ {
27+ gScreen->glInitContextSetEnabled (this, false);
28+ }
29+
30 if ((optionGetLegacyFullscreen () ||
31 optionGetFirefoxMenuFix () ||
32 optionGetOooMenuFix () ||
33@@ -1009,6 +1024,25 @@
34 window->resizeNotify (dx, dy, dwidth, dheight);
35 }
36
37+bool
38+WorkaroundsScreen::glInitContext (XVisualInfo *xvinfo)
39+{
40+ bool status = false;
41+#if defined (__GLIBC__) && (__GLIBC__ >= 2)
42+ /* LP #685682 */
43+ program_invocation_short_name[0] = 'C';
44+#endif
45+
46+ status = gScreen->glInitContext (xvinfo);
47+
48+#if defined (__GLIBC__) && (__GLIBC__ >= 2)
49+ /* LP #685682 */
50+ program_invocation_short_name[0] = 'c';
51+#endif
52+
53+ return status;
54+}
55+
56 WorkaroundsScreen::WorkaroundsScreen (CompScreen *screen) :
57 PluginClassHandler <WorkaroundsScreen, CompScreen> (screen),
58 cScreen (CompositeScreen::get (screen)),
59
60=== modified file 'src/workarounds.h'
61--- src/workarounds.h 2011-05-26 12:52:31 +0000
62+++ src/workarounds.h 2011-10-27 11:52:23 +0000
63@@ -73,6 +73,9 @@
64
65 GL::GLXCopySubBufferProc origCopySubBuffer;
66
67+ bool
68+ glInitContext (XVisualInfo *xvinfo);
69+
70 void
71 handleEvent (XEvent *);
72
73
74=== modified file 'workarounds.xml.in'
75--- workarounds.xml.in 2010-09-28 22:32:21 +0000
76+++ workarounds.xml.in 2011-10-27 11:52:23 +0000
77@@ -88,6 +88,11 @@
78 <_long>Forces the entire screen to redraw every repaint. Use with care, this will cause a massive increase in GPU and CPU usage</_long>
79 <default>false</default>
80 </option>
81+ <option type="bool" name="workaround_glx_create_context_detection">
82+ <_short>Work around drivers that detect older versions of compiz and force indirect rendering</_short>
83+ <_long>Changes the program invocation name while calling into libGL's glXCreateContext so that drivers which check this don't detect older versions of compiz and force indirect rendering</_long>
84+ <default>true</default>
85+ </option>
86 <subgroup>
87 <_short>Window stickyness</_short>
88 <option type="bool" name="sticky_alldesktops">

Subscribers

People subscribed via source and target branches

to all changes: