diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-02-06 18:30:10 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-02-06 18:30:10 +0100 |
| commit | 2c824c155f580935c5d822d2f705fd119945fd99 (patch) | |
| tree | 06f4934baf5ececef7db291a6f0d64c919b6f143 /plugins | |
| parent | 86366b76093cd06f86442952a5b644c45af83109 (diff) | |
unityshell: use the switcher opacity value to compute the final thumbails opacity
(bzr r3132.2.4)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 9 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 863e395ad..d23b087b1 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -812,7 +812,8 @@ void UnityScreen::paintDisplay() { UnityWindow *unity_window = UnityWindow::get(window); double scale = target->result.width / static_cast<double>(target->geo.width); - unity_window->paintThumbnail(target->result, target->alpha, scale, + double parent_alpha = switcher_controller_->Opacity(); + unity_window->paintThumbnail(target->result, target->alpha, parent_alpha, scale, target->decoration_height, target->selected); } } @@ -3787,14 +3788,14 @@ void UnityWindow::paintInnerGlow(nux::Geometry glow_geo, GLMatrix const& matrix, paintGlow(matrix, attrib, quads, glow_texture_, win::decoration::GLOW_COLOR, mask); } -void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float scale_ratio, unsigned deco_height, bool selected) +void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float parent_alpha, float scale_ratio, unsigned deco_height, bool selected) { GLMatrix matrix; matrix.toScreenSpace(UnityScreen::get(screen)->_last_output, -DEFAULT_Z_CAMERA); last_bound = geo; GLWindowPaintAttrib attrib = gWindow->lastPaintAttrib(); - attrib.opacity = (alpha * G_MAXUSHORT); + attrib.opacity = (alpha * parent_alpha * G_MAXUSHORT); unsigned mask = gWindow->lastMask(); nux::Geometry thumb_geo = geo; @@ -3807,7 +3808,7 @@ void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float sc paintThumb(attrib, matrix, mask, g.x, g.y, g.width, g.height, g.width, g.height); mask |= PAINT_WINDOW_BLEND_MASK; - attrib.opacity = OPAQUE; + attrib.opacity = (parent_alpha >= 1.0f) ? OPAQUE : parent_alpha * G_MAXUSHORT; // The thumbnail is still animating, don't draw the decoration as selected if (selected && alpha < 1.0f) diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h index 4d9545673..0d958673e 100644 --- a/plugins/unityshell/src/unityshell.h +++ b/plugins/unityshell/src/unityshell.h @@ -391,7 +391,7 @@ public: CompPoint tryNotIntersectUI(CompPoint& pos); nux::Geometry GetScaledGeometry(); - void paintThumbnail(nux::Geometry const& bounding, float alpha, float scale_ratio, unsigned deco_height, bool selected); + void paintThumbnail(nux::Geometry const& bounding, float parent_alpha, float alpha, float scale_ratio, unsigned deco_height, bool selected); void enterShowDesktop(); void leaveShowDesktop(); |
