diff --git a/autotests/test_window_paint_data.cpp b/autotests/test_window_paint_data.cpp --- a/autotests/test_window_paint_data.cpp +++ b/autotests/test_window_paint_data.cpp @@ -63,6 +63,7 @@ virtual void enablePainting(int reason); virtual EffectWindow *findModal(); virtual const EffectWindowGroup *group() const; + virtual bool isManaged() const; virtual bool isPaintingEnabled(); virtual EffectWindowList mainWindows() const; virtual QByteArray readProperty(long int atom, long int type, int format) const; @@ -121,6 +122,11 @@ return nullptr; } +bool MockEffectWindow::isManaged() const +{ + return true; +} + bool MockEffectWindow::isPaintingEnabled() { return true; diff --git a/effects.h b/effects.h --- a/effects.h +++ b/effects.h @@ -362,6 +362,8 @@ const EffectWindowGroup* group() const override; + bool isManaged() const override; + QRegion shape() const override; QRect decorationInnerRect() const override; QByteArray readProperty(long atom, long type, int format) const override; @@ -406,6 +408,7 @@ QHash dataMap; QHash > m_thumbnails; QList m_desktopThumbnails; + bool m_managed; }; class EffectWindowGroupImpl diff --git a/effects.cpp b/effects.cpp --- a/effects.cpp +++ b/effects.cpp @@ -1599,6 +1599,13 @@ , toplevel(toplevel) , sw(NULL) { + // Deleted windows are not managed. So, when windowClosed signal is + // emitted, effects can't distinguish managed windows from unmanaged + // windows(e.g. combo box popups, popup menus, etc). Save value of + // managed property of the toplevel during construction of EffectWindowImpl, + // so later on, when the toplevel has become Deleted, effects still + // can distinguish managed windows from unmanaged windows. + m_managed = toplevel->isClient(); } EffectWindowImpl::~EffectWindowImpl() @@ -1632,6 +1639,11 @@ return NULL; // TODO } +bool EffectWindowImpl::isManaged() const +{ + return m_managed; +} + void EffectWindowImpl::refWindow() { if (Deleted* d = dynamic_cast< Deleted* >(toplevel)) diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -186,7 +186,7 @@ #define KWIN_EFFECT_API_MAKE_VERSION( major, minor ) (( major ) << 8 | ( minor )) #define KWIN_EFFECT_API_VERSION_MAJOR 0 -#define KWIN_EFFECT_API_VERSION_MINOR 224 +#define KWIN_EFFECT_API_VERSION_MINOR 225 #define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \ KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR ) @@ -2135,7 +2135,7 @@ * Returns whether the window is managed by KWin (it has control over its placement and other * aspects, as opposed to override-redirect windows that are entirely handled by the application). */ - bool isManaged() const; // whether it's managed or override-redirect + virtual bool isManaged() const = 0; // whether it's managed or override-redirect /** * Returns whether or not the window can accept keyboard focus. */ diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -810,7 +810,6 @@ WINDOW_HELPER(bool, isOnScreenDisplay, "onScreenDisplay") WINDOW_HELPER(bool, isComboBox, "comboBox") WINDOW_HELPER(bool, isDNDIcon, "dndIcon") -WINDOW_HELPER(bool, isManaged, "managed") WINDOW_HELPER(bool, isDeleted, "deleted") WINDOW_HELPER(bool, hasOwnShape, "shaped") WINDOW_HELPER(QString, windowRole, "windowRole")