diff --git a/effects.cpp b/effects.cpp index 949ecd96b1..52dda8e9f5 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1343,6 +1343,14 @@ bool EffectWindowImpl::isManaged() const return dynamic_cast< const Client* >( toplevel ) != NULL; } +bool EffectWindowImpl::acceptsFocus() const + { + const Client* client = dynamic_cast< const Client* >( toplevel ); + if( !client ) + return true; // We don't actually know... + return client->wantsInput(); + } + bool EffectWindowImpl::isModal() const { if( Client* c = dynamic_cast< Client* >( toplevel )) diff --git a/effects.h b/effects.h index e78eb7057e..d4416b1a52 100644 --- a/effects.h +++ b/effects.h @@ -237,6 +237,7 @@ class EffectWindowImpl : public EffectWindow virtual bool isComboBox() const; virtual bool isDNDIcon() const; virtual bool isManaged() const; // managed or override-redirect + virtual bool acceptsFocus() const; virtual bool isModal() const; virtual EffectWindow* findModal(); diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 4f7a6d8d2c..b7d0d7988b 100644 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -1268,6 +1268,8 @@ bool PresentWindowsEffect::isSelectableWindow( EffectWindow *w ) return false; if( w->isDeleted() ) return false; + if( !w->acceptsFocus() ) + return false; if( !m_allDesktops && !w->isOnCurrentDesktop() ) return false; if( !m_tabBoxEnabled && m_ignoreMinimized && w->isMinimized() ) diff --git a/lib/kwineffects.h b/lib/kwineffects.h index 206a618df4..89ccf1ec7b 100644 --- a/lib/kwineffects.h +++ b/lib/kwineffects.h @@ -164,7 +164,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 58 +#define KWIN_EFFECT_API_VERSION_MINOR 59 #define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \ KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR ) @@ -843,6 +843,10 @@ class KWIN_EXPORT EffectWindow * aspects, as opposed to override-redirect windows that are entirely handled by the application). */ virtual bool isManaged() const = 0; // whether it's managed or override-redirect + /** + * Returns whether or not the window can accept keyboard focus. + */ + virtual bool acceptsFocus() const = 0; virtual bool isModal() const = 0; virtual EffectWindow* findModal() = 0;