Merge lp:~smspillaz/compiz-core/compiz-core.fix_978900 into lp:compiz-core

Proposed by Sam Spilsbury
Status: Merged
Merged at revision: 3094
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.fix_978900
Merge into: lp:compiz-core
Diff against target: 89 lines (+27/-24)
1 file modified
plugins/decor/src/decor.cpp (+27/-24)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.fix_978900
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
Alan Griffiths Approve
Review via email: mp+101552@code.launchpad.net

Description of the change

== Problem ==

It was possible that the requested paint region would never intersect the allowed region for shadows so windows would always be painted with full shadows. (eg, shadowRegion is a region with a big hole in the middle, and requested paints fell within that hole)

== Solution ==

Intersect against the full output region when checking whether to use the offset region provided.

== Tests ==

already covered.

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM

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

I don't see any change with this branch. At least there are no regressions.

On both the machines I tested, dropdown menu shadows are never clipped at all (bug 659816). So I can't tell if this fix is working.

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

Hmm, my precise test machine is now behaving better than it was yesterday. I'll retest this...

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

Now tested on precise. Sad to say that bug 978900 is not fixed. :(

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

Actually it seems I made a mistake in my debian/patches/series. This fix is now working on precise.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/decor/src/decor.cpp'
2--- plugins/decor/src/decor.cpp 2012-04-08 10:09:51 +0000
3+++ plugins/decor/src/decor.cpp 2012-04-11 13:23:43 +0000
4@@ -214,26 +214,6 @@
5 const CompRegion &region,
6 unsigned int mask)
7 {
8- const CompRegion *preg = NULL;
9-
10- if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
11- PAINT_WINDOW_WITH_OFFSET_MASK)))
12- preg = &region;
13- else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
14- preg = &infiniteRegion;
15- else
16- {
17- tmpRegion = shadowRegion;
18- tmpRegion &= region;
19- preg = &tmpRegion;
20- }
21-
22- /* In case some plugin needs to paint us with an offset region */
23- if (preg->isEmpty ())
24- preg = &region;
25-
26- const CompRegion &reg (*preg);
27-
28 if (wd &&
29 wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP)
30 {
31@@ -241,6 +221,30 @@
32 GLTexture::MatrixList ml (1);
33 mask |= PAINT_WINDOW_BLEND_MASK;
34
35+ const CompRegion *preg = NULL;
36+
37+ if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
38+ PAINT_WINDOW_WITH_OFFSET_MASK)))
39+ preg = &region;
40+ else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
41+ preg = &infiniteRegion;
42+ else
43+ {
44+ tmpRegion = mOutputRegion;
45+ tmpRegion &= region;
46+
47+ if (tmpRegion.isEmpty ())
48+ preg = &region;
49+ else
50+ preg = &shadowRegion;
51+ }
52+
53+ /* In case some plugin needs to paint us with an offset region */
54+ if (preg->isEmpty ())
55+ preg = &region;
56+
57+ const CompRegion &reg (*preg);
58+
59 gWindow->geometry ().reset ();
60
61 for (int i = 0; i < wd->nQuad; i++)
62@@ -262,8 +266,7 @@
63 gWindow->glDrawTexture (wd->decor->texture->textures[0],
64 attrib, mask);
65 }
66- else if (wd && !reg.isEmpty () &&
67- wd->decor->type == WINDOW_DECORATION_TYPE_WINDOW)
68+ else if (wd && wd->decor->type == WINDOW_DECORATION_TYPE_WINDOW)
69 {
70 GLTexture::MatrixList ml (1);
71
72@@ -276,7 +279,7 @@
73 {
74 ml[0] = gWindow->matrices ()[0];
75 gWindow->geometry ().reset ();
76- gWindow->glAddGeometry (ml, window->frameRegion (), reg);
77+ gWindow->glAddGeometry (ml, window->frameRegion (), region);
78
79 if (gWindow->geometry ().vCount)
80 gWindow->glDrawTexture (gWindow->textures ()[0], attrib, mask);
81@@ -289,7 +292,7 @@
82 {
83 ml[0] = gWindow->matrices ()[i];
84 gWindow->geometry ().reset ();
85- gWindow->glAddGeometry (ml, regions[i], reg);
86+ gWindow->glAddGeometry (ml, regions[i], region);
87
88 if (gWindow->geometry ().vCount)
89 gWindow->glDrawTexture (gWindow->textures ()[i], attrib,

Subscribers

People subscribed via source and target branches