From 1fb0e16b47e15545caf15ba3dc91b47ce9cbeee6 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Sat, 13 Dec 2008 09:02:27 +0000 Subject: [PATCH] Various deactivation fading fixes. BUG: 176502 svn path=/trunk/KDE/kdebase/workspace/; revision=896316 --- effects/presentwindows.cpp | 28 ++++++++++++++++------------ effects/presentwindows.h | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/effects/presentwindows.cpp b/effects/presentwindows.cpp index ce3c5e5b0b..e54279f99d 100644 --- a/effects/presentwindows.cpp +++ b/effects/presentwindows.cpp @@ -405,9 +405,9 @@ void PresentWindowsEffect::tabBoxClosed() { if( m_activated ) { - m_tabBoxEnabled = false; effects->unrefTabBox(); - setActive( false ); + setActive( false, true ); + m_tabBoxEnabled = false; } } @@ -1078,13 +1078,13 @@ bool PresentWindowsEffect::isOverlappingAny( EffectWindow *w, const QHashactiveFullScreenEffect() && effects->activeFullScreenEffect() != this ) return; if( m_activated == active ) return; - if( m_activated && m_tabBoxEnabled ) + if( m_activated && m_tabBoxEnabled && !closingTab ) { effects->closeTabBox(); return; @@ -1099,9 +1099,9 @@ void PresentWindowsEffect::setActive( bool active ) foreach( EffectWindow *w, effects->stackingOrder() ) { m_windowData[w].visible = isVisibleWindow( w ); - m_windowData[w].opacity = w->isOnCurrentDesktop() ? 1.0 : 0.0; - if( !m_tabBoxEnabled && m_ignoreMinimized && w->isMinimized() ) - m_windowData[w].opacity = 0.0; + m_windowData[w].opacity = 0.0; + if( w->isOnCurrentDesktop() && !w->isMinimized() ) + m_windowData[w].opacity = 1.0; m_windowData[w].highlight = 1.0; } @@ -1153,11 +1153,15 @@ void PresentWindowsEffect::setActive( bool active ) // Fade in/out all windows foreach( EffectWindow *w, effects->stackingOrder() ) { - // TODO: w->isOnCurrentDesktop(); doesn't seem to be updated immediately - if( m_highlightedWindow ) - m_windowData[w].visible = ( w->desktop() == m_highlightedWindow->desktop() || w->isOnAllDesktops() ) && !w->isMinimized(); - else // Only called when cancelling the effect, so isOnCurrentDesktop() is fine - m_windowData[w].visible = w->isOnCurrentDesktop() && !w->isMinimized(); + EffectWindow *activeWindow = effects->activeWindow(); + if( m_tabBoxEnabled ) + activeWindow = effects->currentTabBoxWindow(); + if( activeWindow ) + m_windowData[w].visible = ( w->desktop() == activeWindow->desktop() || w->isOnAllDesktops() ) && !w->isMinimized(); + else // Deactivating to an empty desktop + m_windowData[w].visible = ( w->isOnCurrentDesktop() || w->isOnAllDesktops() ) && !w->isMinimized(); + if( m_tabBoxEnabled && w == effects->currentTabBoxWindow() ) + m_windowData[w].visible = true; } // Move all windows back to their original position diff --git a/effects/presentwindows.h b/effects/presentwindows.h index 34d9add473..11f2f89416 100644 --- a/effects/presentwindows.h +++ b/effects/presentwindows.h @@ -94,7 +94,7 @@ class PresentWindowsEffect enum { LayoutNatural, LayoutRegularGrid, LayoutFlexibleGrid }; // Layout modes public slots: - void setActive( bool active ); + void setActive( bool active, bool closingTab = false ); // HACK: closingTab shouldn't be needed void toggleActive() { m_allDesktops = false; setActive( !m_activated ); } void toggleActiveAllDesktops() { m_allDesktops = true; setActive( !m_activated ); }