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
=== modified file 'plugins/decor/src/decor.cpp'
--- plugins/decor/src/decor.cpp 2012-04-08 10:09:51 +0000
+++ plugins/decor/src/decor.cpp 2012-04-11 13:23:43 +0000
@@ -214,26 +214,6 @@
214 const CompRegion &region,214 const CompRegion &region,
215 unsigned int mask)215 unsigned int mask)
216{216{
217 const CompRegion *preg = NULL;
218
219 if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
220 PAINT_WINDOW_WITH_OFFSET_MASK)))
221 preg = &region;
222 else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
223 preg = &infiniteRegion;
224 else
225 {
226 tmpRegion = shadowRegion;
227 tmpRegion &= region;
228 preg = &tmpRegion;
229 }
230
231 /* In case some plugin needs to paint us with an offset region */
232 if (preg->isEmpty ())
233 preg = &region;
234
235 const CompRegion &reg (*preg);
236
237 if (wd &&217 if (wd &&
238 wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP)218 wd->decor->type == WINDOW_DECORATION_TYPE_PIXMAP)
239 {219 {
@@ -241,6 +221,30 @@
241 GLTexture::MatrixList ml (1);221 GLTexture::MatrixList ml (1);
242 mask |= PAINT_WINDOW_BLEND_MASK;222 mask |= PAINT_WINDOW_BLEND_MASK;
243223
224 const CompRegion *preg = NULL;
225
226 if ((mask & (PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK |
227 PAINT_WINDOW_WITH_OFFSET_MASK)))
228 preg = &region;
229 else if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
230 preg = &infiniteRegion;
231 else
232 {
233 tmpRegion = mOutputRegion;
234 tmpRegion &= region;
235
236 if (tmpRegion.isEmpty ())
237 preg = &region;
238 else
239 preg = &shadowRegion;
240 }
241
242 /* In case some plugin needs to paint us with an offset region */
243 if (preg->isEmpty ())
244 preg = &region;
245
246 const CompRegion &reg (*preg);
247
244 gWindow->geometry ().reset ();248 gWindow->geometry ().reset ();
245249
246 for (int i = 0; i < wd->nQuad; i++)250 for (int i = 0; i < wd->nQuad; i++)
@@ -262,8 +266,7 @@
262 gWindow->glDrawTexture (wd->decor->texture->textures[0],266 gWindow->glDrawTexture (wd->decor->texture->textures[0],
263 attrib, mask);267 attrib, mask);
264 }268 }
265 else if (wd && !reg.isEmpty () &&269 else if (wd && wd->decor->type == WINDOW_DECORATION_TYPE_WINDOW)
266 wd->decor->type == WINDOW_DECORATION_TYPE_WINDOW)
267 {270 {
268 GLTexture::MatrixList ml (1);271 GLTexture::MatrixList ml (1);
269272
@@ -276,7 +279,7 @@
276 {279 {
277 ml[0] = gWindow->matrices ()[0];280 ml[0] = gWindow->matrices ()[0];
278 gWindow->geometry ().reset ();281 gWindow->geometry ().reset ();
279 gWindow->glAddGeometry (ml, window->frameRegion (), reg);282 gWindow->glAddGeometry (ml, window->frameRegion (), region);
280283
281 if (gWindow->geometry ().vCount)284 if (gWindow->geometry ().vCount)
282 gWindow->glDrawTexture (gWindow->textures ()[0], attrib, mask);285 gWindow->glDrawTexture (gWindow->textures ()[0], attrib, mask);
@@ -289,7 +292,7 @@
289 {292 {
290 ml[0] = gWindow->matrices ()[i];293 ml[0] = gWindow->matrices ()[i];
291 gWindow->geometry ().reset ();294 gWindow->geometry ().reset ();
292 gWindow->glAddGeometry (ml, regions[i], reg);295 gWindow->glAddGeometry (ml, regions[i], region);
293296
294 if (gWindow->geometry ().vCount)297 if (gWindow->geometry ().vCount)
295 gWindow->glDrawTexture (gWindow->textures ()[i], attrib,298 gWindow->glDrawTexture (gWindow->textures ()[i], attrib,

Subscribers

People subscribed via source and target branches