Merge lp:~vanvugt/compiz-core/fix-877920 into lp:compiz-core/0.9.5

Proposed by Daniel van Vugt
Status: Merged
Merged at revision: 2891
Proposed branch: lp:~vanvugt/compiz-core/fix-877920
Merge into: lp:compiz-core/0.9.5
Diff against target: 18 lines (+8/-0)
1 file modified
plugins/opengl/src/paint.cpp (+8/-0)
To merge this branch: bzr merge lp:~vanvugt/compiz-core/fix-877920
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+81436@code.launchpad.net

Description of the change

Prevent windows from becoming unexpectedly translucent (LP: #877920)

This can happen if plugins (like Resize Info) accidentally leave the TexEnvMode in the wrong mode. This fix ensures that glDraw always has the correct GL_TEXTURE_ENV_MODE, and that windows don't randomly become translucent (or worse).

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I've also proposed a fix for the resizeinfo plugin which triggered this bug...
https://code.launchpad.net/~vanvugt/compiz-resizeinfo-plugin/fix-877920/+merge/81435

We should commit both fixes.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I agree with this, although I think in the future it might be more appropriate to have a state machine push/pop functionality in core - in order to change state plugins need to do it through the opengl plugin and we'll have a set of bitflags indicating what state they are changing so that core can handle the reset itself.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

push/pop as in glPushAttrib/glPopAttrib you mean? ;)
http://www.opengl.org/sdk/docs/man/xhtml/glPushAttrib.xml

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/paint.cpp'
2--- plugins/opengl/src/paint.cpp 2011-10-26 23:15:02 +0000
3+++ plugins/opengl/src/paint.cpp 2011-11-07 10:02:23 +0000
4@@ -1189,6 +1189,14 @@
5
6 GLTexture::MatrixList ml (1);
7
8+ //
9+ // Don't assume all plugins leave TexEnvMode in a clean state (GL_REPLACE).
10+ // Sometimes plugins forget to clean up correctly, so make sure we're
11+ // in the correct mode or else windows could be rendered incorrectly
12+ // like in LP: #877920.
13+ //
14+ priv->gScreen->setTexEnvMode (GL_REPLACE);
15+
16 if (priv->textures.size () == 1)
17 {
18 ml[0] = priv->matrices[0];

Subscribers

People subscribed via source and target branches