Merge lp:~vanvugt/unity/fix-1036519 into lp:unity

Proposed by Daniel van Vugt
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2586
Proposed branch: lp:~vanvugt/unity/fix-1036519
Merge into: lp:unity
Diff against target: 51 lines (+26/-0)
1 file modified
plugins/unityshell/src/unityshell.cpp (+26/-0)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-1036519
Reviewer Review Type Date Requested Status
Sam Spilsbury (community) Approve
Review via email: mp+120074@code.launchpad.net

This proposal supersedes a proposal from 2012-08-16.

Commit message

Stop the launcher from overdrawing itself, hence losing transparency. It seems
to happen whenever the panel redraws but the launcher region is not damaged.
I have no idea why redrawing the panel unconditionally redraws the launcher
too, but this works around the problem for now. (LP: #1036519)

Description of the change

Stop the launcher from overdrawing itself, hence losing transparency. It seems
to happen whenever the panel redraws but the launcher region is not damaged.
I have no idea why redrawing the panel unconditionally redraws the launcher
too, but this works around the problem for now. (LP: #1036519)

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

This proposal is on hold until I can prove:
  1. It doesn't affect any potential fix for bug 1036520; and
  2. It doesn't have any significant performance implications.

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

This is fine as a stop gap for now, - we should put a bug in the bug list for lp:unity to remove this code though on figuring out what in nux is causing it.

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

Actually I suspect the problem is the new version of paintDisplay. It doesn't honour the restricted paint region (which is a subset of the damage region) like the old paintDisplay does.

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

Ignore my previous comment. paintDisplay could never handle the paint/damage region properly because Nux only allows for a rectangular clip region.

So this branch is the best solution we have for now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2012-08-16 13:35:30 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-08-17 07:56:22 +0000
4@@ -1358,7 +1358,9 @@
5 for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows)
6 wi->HandleAnimations (ms);
7
8+#ifndef USE_MODERN_COMPIZ_GL
9 compizDamageNux(cScreen->currentDamage());
10+#endif
11
12 didShellRepaint = false;
13 firstWindowAboveShell = NULL;
14@@ -1486,6 +1488,29 @@
15 /* Grab changed nux regions and add damage rects for them */
16 void UnityScreen::nuxDamageCompiz()
17 {
18+#ifdef USE_MODERN_COMPIZ_GL
19+ /*
20+ * If Nux is going to redraw anything then we have to tell Compiz to
21+ * redraw everything. This is because Nux has a bad habit (bug??) of drawing
22+ * more than just the regions of its DrawList. (LP: #1036519)
23+ *
24+ * Forunately, this does not happen on most frames. Only when the Unity
25+ * Shell needs to redraw something.
26+ *
27+ * TODO: Try to figure out why redrawing the panel makes the launcher also
28+ * redraw even though the launcher's geometry is not in DrawList, and
29+ * stop it. Then maybe we can revert back to the old code below #else.
30+ */
31+ std::vector<nux::Geometry> const& dirty = wt->GetDrawList();
32+ if (!dirty.empty())
33+ {
34+ cScreen->damageRegionSetEnabled(this, false);
35+ cScreen->damageScreen();
36+ cScreen->damageRegionSetEnabled(this, true);
37+ }
38+
39+#else
40+
41 /*
42 * WARNING: Nux bug LP: #1014610 (unbounded DrawList growth) will cause
43 * this code to be called far too often in some cases and
44@@ -1536,6 +1561,7 @@
45 cScreen->damageRegionSetEnabled(this, false);
46 cScreen->damageRegion(nux_damage);
47 cScreen->damageRegionSetEnabled(this, true);
48+#endif
49 }
50
51 /* handle X Events */