diff --git a/effects.cpp b/effects.cpp index b07ccc8b08..27198e99ef 100644 --- a/effects.cpp +++ b/effects.cpp @@ -106,7 +106,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type) m_currentBuildQuadsIterator = m_activeEffects.end(); Workspace *ws = Workspace::self(); - connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int))); + connect(ws, SIGNAL(currentDesktopChanged(int, KWin::Client*)), SLOT(slotDesktopChanged(int, KWin::Client*))); connect(ws, SIGNAL(clientAdded(KWin::Client*)), this, SLOT(slotClientAdded(KWin::Client*))); connect(ws, SIGNAL(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(slotUnmanagedAdded(KWin::Unmanaged*))); connect(ws, SIGNAL(clientActivated(KWin::Client*)), this, SLOT(slotClientActivated(KWin::Client*))); @@ -460,10 +460,12 @@ void EffectsHandlerImpl::slotTabRemoved(EffectWindow *w, EffectWindow* leaderOfF emit tabRemoved(w, leaderOfFormerGroup); } -void EffectsHandlerImpl::slotDesktopChanged(int old) +void EffectsHandlerImpl::slotDesktopChanged(int old, Client *c) { const int newDesktop = Workspace::self()->currentDesktop(); if (old != 0 && newDesktop != old) { + emit desktopChanged(old, newDesktop, c ? c->effectWindow() : 0); + // TODO: remove in 4.10 emit desktopChanged(old, newDesktop); } } diff --git a/effects.h b/effects.h index b2055733ba..a65909d231 100644 --- a/effects.h +++ b/effects.h @@ -182,7 +182,7 @@ public Q_SLOTS: void slotHideOutline(); protected Q_SLOTS: - void slotDesktopChanged(int old); + void slotDesktopChanged(int old, KWin::Client *withClient); void slotClientAdded(KWin::Client *c); void slotClientShown(KWin::Toplevel*); void slotUnmanagedAdded(KWin::Unmanaged *u); diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 88913006b6..bd2b07df25 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -846,8 +846,14 @@ Q_SIGNALS: * Signal emitted when the current desktop changed. * @param oldDesktop The previously current desktop * @param newDesktop The new current desktop + * @param with The window which is taken over to the new desktop, can be NULL + * @since 4.9 + */ + void desktopChanged(int oldDesktop, int newDesktop, KWin::EffectWindow *with); + /** * @since 4.7 - **/ + * @deprecated + */ void desktopChanged(int oldDesktop, int newDesktop); /** * Signal emitted when the number of currently existing desktops is changed. diff --git a/scripting/workspace_wrapper.cpp b/scripting/workspace_wrapper.cpp index 122ea0fee6..8aef2eb48c 100644 --- a/scripting/workspace_wrapper.cpp +++ b/scripting/workspace_wrapper.cpp @@ -31,7 +31,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent) { KWin::Workspace *ws = KWin::Workspace::self(); connect(ws, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SIGNAL(desktopPresenceChanged(KWin::Client*,int))); - connect(ws, SIGNAL(currentDesktopChanged(int)), SIGNAL(currentDesktopChanged(int))); + connect(ws, SIGNAL(currentDesktopChanged(int,KWin::Client*)), SIGNAL(currentDesktopChanged(int,KWin::Client*))); connect(ws, SIGNAL(clientAdded(KWin::Client*)), SIGNAL(clientAdded(KWin::Client*))); connect(ws, SIGNAL(clientAdded(KWin::Client*)), SLOT(setupClientConnections(KWin::Client*))); connect(ws, SIGNAL(clientRemoved(KWin::Client*)), SIGNAL(clientRemoved(KWin::Client*))); diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index 77d9433c63..f9f91cbd28 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -68,7 +68,7 @@ private: signals: void desktopPresenceChanged(KWin::Client *client, int desktop); - void currentDesktopChanged(int desktop); + void currentDesktopChanged(int desktop, KWin::Client *client); void clientAdded(KWin::Client *client); void clientRemoved(KWin::Client *client); void clientManaging(KWin::Client *client); diff --git a/workspace.cpp b/workspace.cpp index eee91efe8b..2d0103f811 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1426,7 +1426,7 @@ bool Workspace::setCurrentDesktop(int new_desktop) if (compositing()) addRepaintFull(); - emit currentDesktopChanged(old_desktop); + emit currentDesktopChanged(old_desktop, movingClient); return true; } diff --git a/workspace.h b/workspace.h index d8f9d13cc5..73c1c880f2 100644 --- a/workspace.h +++ b/workspace.h @@ -684,7 +684,7 @@ Q_SIGNALS: //Signals required for the scripting interface signals: void desktopPresenceChanged(KWin::Client*, int); - void currentDesktopChanged(int); + void currentDesktopChanged(int, KWin::Client*); void numberDesktopsChanged(int oldNumberOfDesktops); void clientAdded(KWin::Client*); void clientRemoved(KWin::Client*);