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 ) @@ -2242,6 +2242,10 @@ * @since 4.11 */ virtual void unreferencePreviousWindowPixmap() = 0; + +private: + class Private; + QScopedPointer d; }; class KWINEFFECTS_EXPORT EffectWindowGroup diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -767,9 +767,32 @@ // EffectWindow //**************************************** +class Q_DECL_HIDDEN EffectWindow::Private +{ +public: + Private(EffectWindow *q); + + EffectWindow *q; + bool managed = false; +}; + +EffectWindow::Private::Private(EffectWindow *q) + : q(q) +{ +} + EffectWindow::EffectWindow(QObject *parent) : QObject(parent) + , d(new Private(this)) { + // 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 the + // managed property during construction of EffectWindow. At that time, + // parent can be Client, ShellClient, or Unmanaged. So, later on, when + // an instance of Deleted becomes parent of the EffectWindow, effects + // can still figure out whether it is/was a managed window. + d->managed = parent->property("managed").value(); } EffectWindow::~EffectWindow() @@ -810,7 +833,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") @@ -963,6 +985,11 @@ && isOnCurrentActivity(); } +bool EffectWindow::isManaged() const +{ + return d->managed; +} + //**************************************** // EffectWindowGroup