Merge lp:~sil2100/compiz-core/cherry_3258 into lp:compiz-core

Proposed by Łukasz Zemczak on 2012-07-16
Status: Merged
Merged at revision: 3115
Proposed branch: lp:~sil2100/compiz-core/cherry_3258
Merge into: lp:compiz-core
Diff against target: 39 lines (+24/-3)
1 file modified
plugins/decor/src/decor.cpp (+24/-3)
To merge this branch: bzr merge lp:~sil2100/compiz-core/cherry_3258
Reviewer Review Type Date Requested Status
Daniel van Vugt 2012-07-16 Approve on 2012-07-17
Review via email: mp+115145@code.launchpad.net

Commit message

Cherry-picked from compiz trunk (rev 3258):

Check if the window would actually paint before painting the shadow, since it is possible that another plugin could be inhibiting paint of the dock window. (LP: #1012956)

Description of the change

Just checking if it's possible for this to be included in an SRU as well.

Cherry-picked from compiz trunk (rev 3258):

Check if the window would actually paint before painting the shadow, since it is possible that another plugin could be inhibiting paint of the dock window. (LP: #1012956)

To post a comment you must log in.
Daniel van Vugt (vanvugt) wrote :

Yep, looks like the fix from upstream.

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-06-15 16:41:34 +0000
3+++ plugins/decor/src/decor.cpp 2012-07-16 13:52:52 +0000
4@@ -195,11 +195,32 @@
5 {
6 foreach (CompWindow *w, dScreen->cScreen->getWindowPaintList ())
7 {
8- if ((w->type () & CompWindowTypeDockMask) &&
9- !(w->destroyed () || w->invisible ()))
10+ bool isDock = w->type () & CompWindowTypeDockMask;
11+ bool drawShadow = !(w->invisible () || w->destroyed ());
12+
13+ if (isDock && drawShadow)
14 {
15 DecorWindow *d = DecorWindow::get (w);
16- d->glDecorate (transform, attrib, region, mask);
17+
18+ /* If the last mask was an occlusion pass, glPaint
19+ * return value will mean something different, so
20+ * remove it */
21+ unsigned int pmask = d->gWindow->lastMask () &
22+ ~(PAINT_WINDOW_OCCLUSION_DETECTION_MASK);
23+
24+ /* Check if the window would draw by seeing if glPaint
25+ * returns true when using PAINT_NO_CORE_INSTANCE_MASK
26+ */
27+ pmask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
28+
29+ if (d->gWindow->glPaint (d->gWindow->paintAttrib (),
30+ transform,
31+ region,
32+ pmask))
33+ {
34+ GLFragment::Attrib fa (d->gWindow->paintAttrib ());
35+ d->glDecorate (transform, fa, region, mask);
36+ }
37 }
38 }
39 }

Subscribers

People subscribed via source and target branches