Merge lp:~vanvugt/unity/fix-1057528-6 into lp:unity/6.0

Proposed by Daniel van Vugt
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: no longer in the source branch.
Merged at revision: 2774
Proposed branch: lp:~vanvugt/unity/fix-1057528-6
Merge into: lp:unity/6.0
Diff against target: 96 lines (+39/-18)
2 files modified
manual-tests/Panel.txt (+16/-0)
plugins/unityshell/src/unityshell.cpp (+23/-18)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-1057528-6
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+129079@code.launchpad.net

Commit message

Draw the panel shadow only within the redraw region. Using a bounding box
allowed parts to get redrawn when they should not, appearing as small chunks
of extra-dark panel shadow.
(LP: #1057528)

Description of the change

Backport to Unity 6.x. Already committed to Unity 7.0

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Tested, code looking good, manual test enough. +1

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1524/console reported an error when processing this lp:~vanvugt/unity/fix-1057528-6 branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'manual-tests/Panel.txt'
2--- manual-tests/Panel.txt 2012-08-23 16:55:54 +0000
3+++ manual-tests/Panel.txt 2012-10-11 01:42:37 +0000
4@@ -95,3 +95,19 @@
5 At no point during the actions should the panel (or launcher) blink or
6 flicker out of existence.
7
8+
9+Panel shadow overdraw
10+---------------------
11+Setup:
12+#. Install Google Chrome or Chromium.
13+
14+Actions:
15+#. Maximize a Chrome window.
16+#. Open several tabs so that the titles of some tabs are not fully visible
17+ and fade out to the right.
18+#. Hover the mouse over the very top part of some tabs so tooltips appear.
19+
20+Expected Result:
21+ No part of the panel shadow should ever appear on top of the maximized
22+ Chrome window.
23+
24
25=== modified file 'plugins/unityshell/src/unityshell.cpp'
26--- plugins/unityshell/src/unityshell.cpp 2012-10-05 16:39:02 +0000
27+++ plugins/unityshell/src/unityshell.cpp 2012-10-11 01:42:37 +0000
28@@ -548,6 +548,9 @@
29
30 void UnityScreen::paintPanelShadow(const CompRegion& clip)
31 {
32+ if (panel_controller_->opacity() == 0.0f)
33+ return;
34+
35 if (sources_.GetSource(local::RELAYOUT_TIMEOUT))
36 return;
37
38@@ -573,22 +576,6 @@
39 if (redraw.isEmpty())
40 return;
41
42- const CompRect& bounds(redraw.boundingRect());
43-
44- // Sub-rectangle of the shadow needing redrawing:
45- float x1 = bounds.x1();
46- float y1 = bounds.y1();
47- float x2 = bounds.x2();
48- float y2 = bounds.y2();
49-
50- // Texture coordinates of the above rectangle:
51- float tx1 = (x1 - shadowX) / shadowWidth;
52- float ty1 = (y1 - shadowY) / shadowHeight;
53- float tx2 = (x2 - shadowX) / shadowWidth;
54- float ty2 = (y2 - shadowY) / shadowHeight;
55-
56- nuxPrologue();
57-
58 // compiz doesn't use the same method of tracking monitors as our toolkit
59 // we need to make sure we properly associate with the right monitor
60 int current_monitor = -1;
61@@ -604,8 +591,14 @@
62 i++;
63 }
64
65- if (!(launcher_controller_->IsOverlayOpen() && current_monitor == overlay_monitor_)
66- && panel_controller_->opacity() > 0.0f)
67+ if (launcher_controller_->IsOverlayOpen() && current_monitor == overlay_monitor_)
68+ return;
69+
70+ nuxPrologue();
71+
72+ const CompRect::vector& rects = redraw.rects();
73+
74+ for (auto const& r : rects)
75 {
76 foreach(GLTexture * tex, _shadow_texture)
77 {
78@@ -627,6 +620,18 @@
79 (GLushort)(panel_controller_->opacity() * 0xFFFF)
80 };
81
82+ // Sub-rectangle of the shadow needing redrawing:
83+ float x1 = r.x1();
84+ float y1 = r.y1();
85+ float x2 = r.x2();
86+ float y2 = r.y2();
87+
88+ // Texture coordinates of the above rectangle:
89+ float tx1 = (x1 - shadowX) / shadowWidth;
90+ float ty1 = (y1 - shadowY) / shadowHeight;
91+ float tx2 = (x2 - shadowX) / shadowWidth;
92+ float ty2 = (y2 - shadowY) / shadowHeight;
93+
94 vertexData = {
95 x1, y1, 0,
96 x1, y2, 0,

Subscribers

People subscribed via source and target branches