diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-07 02:37:39 +0100 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-07 02:37:39 +0100 |
| commit | 5676f4fbfa1ebf42cab107e368e655bc459fe764 (patch) | |
| tree | 58286e2c55b733b2e8d983155f84efafa78d0acf /plugins | |
| parent | 0512da318668606523f6d29eee829e25f56f6ef8 (diff) | |
UnityWindow: add proper cross-fading when the lockscreen is about to show/hide
Also, we override the paint priority making sure that no other plugin might cause a window not to be painted with the opacity we desire (bzr r3695.4.49)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 0a1db968b..8ee2a9bab 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -2822,10 +2822,18 @@ bool UnityWindow::glPaint(const GLWindowPaintAttrib& attrib, if (window->type() != CompWindowTypePopupMenuMask) { - if (uScreen->lockscreen_controller_->IsShielded()) + if (uScreen->lockscreen_controller_->IsLocked()) { - wAttrib.opacity = 0; - return gWindow->glPaint(wAttrib, matrix, region, mask); + // For some reasons PAINT_WINDOW_NO_CORE_INSTANCE_MASK doesn't work here + // (well, it works too much, as it applies to menus too), so we need + // to paint the windows at the proper opacity, overriding any other + // paint plugin (animation, fade?) that might interfere with us. + wAttrib.opacity = COMPIZ_COMPOSITE_OPAQUE * (1.0f - uScreen->lockscreen_controller_->Opacity()); + int old_index = gWindow->glPaintGetCurrentIndex(); + gWindow->glPaintSetCurrentIndex(MAXSHORT); + bool ret = gWindow->glPaint(wAttrib, matrix, region, mask); + gWindow->glPaintSetCurrentIndex(old_index); + return ret; } } |
