summaryrefslogtreecommitdiff
diff options
-rw-r--r--manual-tests/Panel.txt16
-rw-r--r--plugins/unityshell/src/unityshell.cpp41
2 files changed, 39 insertions, 18 deletions
diff --git a/manual-tests/Panel.txt b/manual-tests/Panel.txt
index d36af4588..d7d74676a 100644
--- a/manual-tests/Panel.txt
+++ b/manual-tests/Panel.txt
@@ -95,3 +95,19 @@ Expected Result:
At no point during the actions should the panel (or launcher) blink or
flicker out of existence.
+
+Panel shadow overdraw
+---------------------
+Setup:
+#. Install Google Chrome or Chromium.
+
+Actions:
+#. Maximize a Chrome window.
+#. Open several tabs so that the titles of some tabs are not fully visible
+ and fade out to the right.
+#. Hover the mouse over the very top part of some tabs so tooltips appear.
+
+Expected Result:
+ No part of the panel shadow should ever appear on top of the maximized
+ Chrome window.
+
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 01f40c744..571c8f82a 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -560,6 +560,9 @@ void UnityScreen::setPanelShadowMatrix(const GLMatrix& matrix)
void UnityScreen::paintPanelShadow(const CompRegion& clip)
{
+ if (panel_controller_->opacity() == 0.0f)
+ return;
+
if (sources_.GetSource(local::RELAYOUT_TIMEOUT))
return;
@@ -585,22 +588,6 @@ void UnityScreen::paintPanelShadow(const CompRegion& clip)
if (redraw.isEmpty())
return;
- const CompRect& bounds(redraw.boundingRect());
-
- // Sub-rectangle of the shadow needing redrawing:
- float x1 = bounds.x1();
- float y1 = bounds.y1();
- float x2 = bounds.x2();
- float y2 = bounds.y2();
-
- // Texture coordinates of the above rectangle:
- float tx1 = (x1 - shadowX) / shadowWidth;
- float ty1 = (y1 - shadowY) / shadowHeight;
- float tx2 = (x2 - shadowX) / shadowWidth;
- float ty2 = (y2 - shadowY) / shadowHeight;
-
- nuxPrologue();
-
// compiz doesn't use the same method of tracking monitors as our toolkit
// we need to make sure we properly associate with the right monitor
int current_monitor = -1;
@@ -616,8 +603,14 @@ void UnityScreen::paintPanelShadow(const CompRegion& clip)
i++;
}
- if (!(launcher_controller_->IsOverlayOpen() && current_monitor == overlay_monitor_)
- && panel_controller_->opacity() > 0.0f)
+ if (launcher_controller_->IsOverlayOpen() && current_monitor == overlay_monitor_)
+ return;
+
+ nuxPrologue();
+
+ const CompRect::vector& rects = redraw.rects();
+
+ for (auto const& r : rects)
{
foreach(GLTexture * tex, _shadow_texture)
{
@@ -639,6 +632,18 @@ void UnityScreen::paintPanelShadow(const CompRegion& clip)
(GLushort)(panel_controller_->opacity() * 0xFFFF)
};
+ // Sub-rectangle of the shadow needing redrawing:
+ float x1 = r.x1();
+ float y1 = r.y1();
+ float x2 = r.x2();
+ float y2 = r.y2();
+
+ // Texture coordinates of the above rectangle:
+ float tx1 = (x1 - shadowX) / shadowWidth;
+ float ty1 = (y1 - shadowY) / shadowHeight;
+ float tx2 = (x2 - shadowX) / shadowWidth;
+ float ty2 = (y2 - shadowY) / shadowHeight;
+
vertexData = {
x1, y1, 0,
x1, y2, 0,