summaryrefslogtreecommitdiff
path: root/plugins/unityshell/src
diff options
Diffstat (limited to 'plugins/unityshell/src')
-rw-r--r--plugins/unityshell/src/unityshell.cpp41
1 files changed, 23 insertions, 18 deletions
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,