Added EffectWindow::acceptsFocus(). Prevent present windows from
displaying windows that cannot be focused anyway (Such as conky). svn path=/trunk/KDE/kdebase/workspace/; revision=923091
This commit is contained in:
parent
b4151d2103
commit
13c2f21e9d
4 changed files with 16 additions and 1 deletions
|
@ -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 ))
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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() )
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue