Commit 695fb69a authored by Thomas Lübking's avatar Thomas Lübking
Browse files

add desktopChanged signal to effects that carries the optionally changing widget

CCBUG: 213847
FIXED-IN: 4.9
parent ace7f427
......@@ -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);
}
}
......
......@@ -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);
......
......@@ -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.
......
......@@ -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*)));
......
......@@ -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);
......
......@@ -1426,7 +1426,7 @@ bool Workspace::setCurrentDesktop(int new_desktop)
if (compositing())
addRepaintFull();
emit currentDesktopChanged(old_desktop);
emit currentDesktopChanged(old_desktop, movingClient);
return true;
}
......
......@@ -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*);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment