diff --git a/effects.cpp b/effects.cpp index 8c97995fa9..4fe22a8d80 100644 --- a/effects.cpp +++ b/effects.cpp @@ -596,6 +596,10 @@ void EffectsHandlerImpl::setShowingDesktop(bool showing) Workspace::self()->setShowingDesktop(showing); } +QString EffectsHandlerImpl::currentActivity() const +{ + return Workspace::self()->currentActivity(); +} int EffectsHandlerImpl::currentDesktop() const { @@ -1209,6 +1213,16 @@ int EffectWindowImpl::desktop() const return toplevel->desktop(); } +bool EffectWindowImpl::isOnActivity(QString activity) const +{ + return toplevel->isOnActivity(activity); +} + +bool EffectWindowImpl::isOnAllActivities() const +{ + return toplevel->isOnAllActivities(); +} + bool EffectWindowImpl::isOnAllDesktops() const { return desktop() == NET::OnAllDesktops; diff --git a/effects.h b/effects.h index cdfcffe642..753447b4a5 100644 --- a/effects.h +++ b/effects.h @@ -68,6 +68,7 @@ public: virtual void windowToScreen(EffectWindow* w, int screen); virtual void setShowingDesktop(bool showing); + virtual QString currentActivity() const; virtual int currentDesktop() const; virtual int numberOfDesktops() const; virtual void setCurrentDesktop(int desktop); @@ -225,6 +226,9 @@ public: virtual void unrefWindow(); virtual bool isDeleted() const; + virtual bool isOnActivity(QString id) const; + virtual bool isOnAllActivities() const; + virtual bool isOnAllDesktops() const; virtual int desktop() const; // prefer isOnXXX() virtual bool isMinimized() const; diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp old mode 100644 new mode 100755 index 816e4a5e22..8b7a65f2f6 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -1615,6 +1615,8 @@ void PresentWindowsEffect::updateFilterFrame() bool PresentWindowsEffect::isSelectableWindow(EffectWindow *w) { + if (!w->isOnCurrentActivity()) + return false; if (w->isSpecialWindow() || w->isUtility()) return false; if (w->isDeleted()) diff --git a/libkwineffects/kwineffects.cpp b/libkwineffects/kwineffects.cpp index 427bf76291..45a075a14e 100644 --- a/libkwineffects/kwineffects.cpp +++ b/libkwineffects/kwineffects.cpp @@ -304,6 +304,11 @@ EffectWindow::~EffectWindow() { } +bool EffectWindow::isOnCurrentActivity() const +{ + return isOnActivity(effects->currentActivity()); +} + bool EffectWindow::isOnCurrentDesktop() const { return isOnDesktop(effects->currentDesktop()); diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 0fa7f9e704..23106024f1 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -593,6 +593,12 @@ public: virtual void windowToScreen(EffectWindow* w, int screen) = 0; virtual void setShowingDesktop(bool showing) = 0; + + // Activities + /** + * @returns The ID of the current activity. + */ + virtual QString currentActivity() const = 0; // Desktops /** * @returns The ID of the current desktop. @@ -1031,6 +1037,10 @@ public: virtual double opacity() const = 0; virtual bool hasAlpha() const = 0; + virtual bool isOnCurrentActivity() const; + virtual bool isOnActivity(QString id) const = 0; + virtual bool isOnAllActivities() const = 0; + virtual bool isOnDesktop(int d) const; virtual bool isOnCurrentDesktop() const; virtual bool isOnAllDesktops() const = 0;