From 7d897b7d3f3be59b79e6efaac361a78b28c03e04 Mon Sep 17 00:00:00 2001 From: Lucas Murray Date: Wed, 23 Dec 2009 01:44:23 +0000 Subject: [PATCH] Added PAINT_DISABLED_BY_CLIENT_GROUP. Allow highlighting of inactive tab windows in box switch. svn path=/trunk/KDE/kdebase/workspace/; revision=1065321 --- effects/boxswitch/boxswitch.cpp | 4 +++- effects/highlightwindow/highlightwindow.cpp | 2 +- lib/kwineffects.h | 12 +++++++----- scene.cpp | 4 +++- scene.h | 10 ++++++---- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/effects/boxswitch/boxswitch.cpp b/effects/boxswitch/boxswitch.cpp index 25aaf88598..ba3ea860b0 100644 --- a/effects/boxswitch/boxswitch.cpp +++ b/effects/boxswitch/boxswitch.cpp @@ -95,7 +95,9 @@ void BoxSwitchEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, { if( windows.contains( w )) { - if( w != selected_window ) + if( w == selected_window ) + w->enablePainting( EffectWindow::PAINT_DISABLED_BY_CLIENT_GROUP ); + else data.setTranslucent(); w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE | EffectWindow::PAINT_DISABLED_BY_DESKTOP ); } diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp index b55946e380..a57e104b3a 100644 --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -89,7 +89,7 @@ void HighlightWindowEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& if( m_windowOpacity.contains( w ) && m_windowOpacity[w] != 0.0 ) { if( !w->visibleInClientGroup() ) - w->enablePainting( EffectWindow::PAINT_DISABLED ); + w->enablePainting( EffectWindow::PAINT_DISABLED_BY_CLIENT_GROUP ); if( !w->isOnCurrentDesktop() ) w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP ); } diff --git a/lib/kwineffects.h b/lib/kwineffects.h index a99b8c34cb..04e4988d59 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -170,7 +170,7 @@ X-KDE-Library=kwin4_effect_cooleffect #define KWIN_EFFECT_API_MAKE_VERSION( major, minor ) (( major ) << 8 | ( minor )) #define KWIN_EFFECT_API_VERSION_MAJOR 0 -#define KWIN_EFFECT_API_VERSION_MINOR 110 +#define KWIN_EFFECT_API_VERSION_MINOR 111 #define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \ KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR ) @@ -787,13 +787,15 @@ class KWIN_EXPORT EffectWindow enum { /** Window will not be painted */ - PAINT_DISABLED = 1 << 0, + PAINT_DISABLED = 1 << 0, /** Window will not be painted because it is deleted */ - PAINT_DISABLED_BY_DELETE = 1 << 1, + PAINT_DISABLED_BY_DELETE = 1 << 1, /** Window will not be painted because of which desktop it's on */ - PAINT_DISABLED_BY_DESKTOP = 1 << 2, + PAINT_DISABLED_BY_DESKTOP = 1 << 2, /** Window will not be painted because it is minimized */ - PAINT_DISABLED_BY_MINIMIZE = 1 << 3 + PAINT_DISABLED_BY_MINIMIZE = 1 << 3, + /** Window will not be painted because it is not the active window in a client group */ + PAINT_DISABLED_BY_CLIENT_GROUP = 1 << 4 }; EffectWindow(); diff --git a/scene.cpp b/scene.cpp index 69e2afc677..86629e2e2f 100644 --- a/scene.cpp +++ b/scene.cpp @@ -456,7 +456,9 @@ void Scene::Window::resetPaintingEnabled() { if( c->isMinimized() ) disable_painting |= PAINT_DISABLED_BY_MINIMIZE; - if( c->isHiddenInternal()) + if( c->clientGroup() && c != c->clientGroup()->visible() ) + disable_painting |= PAINT_DISABLED_BY_CLIENT_GROUP; + else if( c->isHiddenInternal()) disable_painting |= PAINT_DISABLED; } } diff --git a/scene.h b/scene.h index 1de771feb2..0235523817 100644 --- a/scene.h +++ b/scene.h @@ -170,13 +170,15 @@ class Scene::Window enum { // Window will not be painted - PAINT_DISABLED = 1 << 0, + PAINT_DISABLED = 1 << 0, // Window will not be painted because it is deleted - PAINT_DISABLED_BY_DELETE = 1 << 1, + PAINT_DISABLED_BY_DELETE = 1 << 1, // Window will not be painted because of which desktop it's on - PAINT_DISABLED_BY_DESKTOP = 1 << 2, + PAINT_DISABLED_BY_DESKTOP = 1 << 2, // Window will not be painted because it is minimized - PAINT_DISABLED_BY_MINIMIZE = 1 << 3 + PAINT_DISABLED_BY_MINIMIZE = 1 << 3, + // Window will not be painted because it is not the active window in a client group + PAINT_DISABLED_BY_CLIENT_GROUP = 1 << 4 }; void enablePainting( int reason ); void disablePainting( int reason );