EffectsHandler emits windowClosed signal

Client and Unmanaged use a signal to notify that they are about to be closed.
The EffectsHandlerImpl is connected to those signals and emits the appropriate
windowClosed signal to which the effects are connected.
This commit is contained in:
Martin Gräßlin 2011-02-27 09:25:45 +01:00
parent ab6f2ba1fd
commit 0b85768ec5
51 changed files with 135 additions and 57 deletions

View file

@ -234,8 +234,8 @@ void Client::releaseWindow(bool on_shutdown)
assert(!deleting); assert(!deleting);
deleting = true; deleting = true;
Deleted* del = Deleted::create(this); Deleted* del = Deleted::create(this);
if (effects) { emit clientClosed(this);
static_cast<EffectsHandlerImpl*>(effects)->windowClosed(effectWindow()); if (scene) {
scene->windowClosed(this, del); scene->windowClosed(this, del);
} }
finishCompositing(); finishCompositing();
@ -302,8 +302,8 @@ void Client::destroyClient()
assert(!deleting); assert(!deleting);
deleting = true; deleting = true;
Deleted* del = Deleted::create(this); Deleted* del = Deleted::create(this);
if (effects) { emit clientClosed(this);
static_cast<EffectsHandlerImpl*>(effects)->windowClosed(effectWindow()); if (scene) {
scene->windowClosed(this, del); scene->windowClosed(this, del);
} }
finishCompositing(); finishCompositing();

View file

@ -494,6 +494,7 @@ signals:
void maximizeSet(QPair<bool, bool>); void maximizeSet(QPair<bool, bool>);
void s_activated(); void s_activated();
void s_fullScreenSet(bool, bool); void s_fullScreenSet(bool, bool);
void clientClosed(KWin::Client*);
// To make workspace-client calls, a few slots are also // To make workspace-client calls, a few slots are also
// required // required

View file

@ -99,6 +99,13 @@ EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type)
connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int))); connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int)));
connect(ws, SIGNAL(clientAdded(KWin::Client*)), this, SLOT(slotClientAdded(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(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(slotUnmanagedAdded(KWin::Unmanaged*)));
// connect all clients
foreach (Client *c, ws->clientList()) {
connect(c, SIGNAL(clientClosed(KWin::Client*)), this, SLOT(slotClientClosed(KWin::Client*)));
}
foreach (Unmanaged *u, ws->unmanagedList()) {
connect(u, SIGNAL(unmanagedClosed(KWin::Unmanaged*)), this, SLOT(slotUnmanagedClosed(KWin::Unmanaged*)));
}
reconfigure(); reconfigure();
} }
@ -285,11 +292,13 @@ void EffectsHandlerImpl::windowOpacityChanged(EffectWindow* c, double old_opacit
void EffectsHandlerImpl::slotClientAdded(Client *c) void EffectsHandlerImpl::slotClientAdded(Client *c)
{ {
connect(c, SIGNAL(clientClosed(KWin::Client*)), this, SLOT(slotClientClosed(KWin::Client*)));
emit windowAdded(c->effectWindow()); emit windowAdded(c->effectWindow());
} }
void EffectsHandlerImpl::slotUnmanagedAdded(Unmanaged *u) void EffectsHandlerImpl::slotUnmanagedAdded(Unmanaged *u)
{ {
connect(u, SIGNAL(unmanagedClosed(KWin::Unmanaged*)), this, SLOT(slotUnmanagedClosed(KWin::Unmanaged*)));
emit windowAdded(u->effectWindow()); emit windowAdded(u->effectWindow());
} }
@ -300,10 +309,14 @@ void EffectsHandlerImpl::windowDeleted(EffectWindow* c)
elevated_windows.removeAll(c); elevated_windows.removeAll(c);
} }
void EffectsHandlerImpl::windowClosed(EffectWindow* c) void EffectsHandlerImpl::slotClientClosed(Client *c)
{ {
foreach (const EffectPair & ep, loaded_effects) emit windowClosed(c->effectWindow());
ep.second->windowClosed(c); }
void EffectsHandlerImpl::slotUnmanagedClosed(Unmanaged* u)
{
emit windowClosed(u->effectWindow());
} }
void EffectsHandlerImpl::windowActivated(EffectWindow* c) void EffectsHandlerImpl::windowActivated(EffectWindow* c)

View file

@ -160,7 +160,6 @@ public:
void windowUserMovedResized(EffectWindow* c, bool first, bool last); void windowUserMovedResized(EffectWindow* c, bool first, bool last);
void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry); void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
void windowOpacityChanged(EffectWindow* c, double old_opacity); void windowOpacityChanged(EffectWindow* c, double old_opacity);
void windowClosed(EffectWindow* c);
void windowDeleted(EffectWindow* c); void windowDeleted(EffectWindow* c);
void windowActivated(EffectWindow* c); void windowActivated(EffectWindow* c);
void windowMinimized(EffectWindow* c); void windowMinimized(EffectWindow* c);
@ -197,6 +196,8 @@ protected Q_SLOTS:
void slotDesktopChanged(int old); void slotDesktopChanged(int old);
void slotClientAdded(KWin::Client *c); void slotClientAdded(KWin::Client *c);
void slotUnmanagedAdded(KWin::Unmanaged *u); void slotUnmanagedAdded(KWin::Unmanaged *u);
void slotClientClosed(KWin::Client *c);
void slotUnmanagedClosed(KWin::Unmanaged *u);
protected: protected:
KLibrary* findEffectLibrary(KService* service); KLibrary* findEffectLibrary(KService* service);

View file

@ -57,6 +57,7 @@ BoxSwitchEffect::BoxSwitchEffect()
highlight_margin = 10; highlight_margin = 10;
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
BoxSwitchEffect::~BoxSwitchEffect() BoxSwitchEffect::~BoxSwitchEffect()
@ -475,7 +476,7 @@ void BoxSwitchEffect::setSelectedWindow(EffectWindow* w)
} }
} }
void BoxSwitchEffect::windowClosed(EffectWindow* w) void BoxSwitchEffect::slotWindowClosed(EffectWindow* w)
{ {
if (w == selected_window) { if (w == selected_window) {
setSelectedWindow(0); setSelectedWindow(0);

View file

@ -41,6 +41,7 @@ namespace KWin
class BoxSwitchEffect class BoxSwitchEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
BoxSwitchEffect(); BoxSwitchEffect();
~BoxSwitchEffect(); ~BoxSwitchEffect();
@ -57,10 +58,13 @@ public:
virtual void tabBoxAdded(int mode); virtual void tabBoxAdded(int mode);
virtual void tabBoxClosed(); virtual void tabBoxClosed();
virtual void tabBoxUpdated(); virtual void tabBoxUpdated();
virtual void windowClosed(EffectWindow* w);
virtual void* proxy(); virtual void* proxy();
void activateFromProxy(int mode, bool animate, bool showText, float positioningFactor); void activateFromProxy(int mode, bool animate, bool showText, float positioningFactor);
void paintWindowsBox(const QRegion& region); void paintWindowsBox(const QRegion& region);
public Q_SLOTS:
void slotWindowClosed(EffectWindow* w);
private: private:
class ItemInfo; class ItemInfo;
void setActive(); void setActive();

View file

@ -70,6 +70,7 @@ CoverSwitchEffect::CoverSwitchEffect()
const QString fragmentshader = KGlobal::dirs()->findResource("data", "kwin/coverswitch-reflection.glsl"); const QString fragmentshader = KGlobal::dirs()->findResource("data", "kwin/coverswitch-reflection.glsl");
m_reflectionShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader); m_reflectionShader = ShaderManager::instance()->loadFragmentShader(ShaderManager::GenericShader, fragmentshader);
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
CoverSwitchEffect::~CoverSwitchEffect() CoverSwitchEffect::~CoverSwitchEffect()
@ -981,7 +982,7 @@ void CoverSwitchEffect::abort()
captionFrame->free(); captionFrame->free();
} }
void CoverSwitchEffect::windowClosed(EffectWindow* c) void CoverSwitchEffect::slotWindowClosed(EffectWindow* c)
{ {
// if the list is not empty, the effect is active // if the list is not empty, the effect is active
if (!currentWindowList.isEmpty()) { if (!currentWindowList.isEmpty()) {

View file

@ -36,6 +36,7 @@ namespace KWin
class CoverSwitchEffect class CoverSwitchEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
CoverSwitchEffect(); CoverSwitchEffect();
~CoverSwitchEffect(); ~CoverSwitchEffect();
@ -49,9 +50,12 @@ public:
virtual void tabBoxClosed(); virtual void tabBoxClosed();
virtual void tabBoxUpdated(); virtual void tabBoxUpdated();
virtual void windowInputMouseEvent(Window w, QEvent* e); virtual void windowInputMouseEvent(Window w, QEvent* e);
virtual void windowClosed(EffectWindow* c);
static bool supported(); static bool supported();
public Q_SLOTS:
void slotWindowClosed(EffectWindow *c);
private: private:
void paintScene(EffectWindow* frontWindow, const EffectWindowList& leftWindows, const EffectWindowList& rightWindows, void paintScene(EffectWindow* frontWindow, const EffectWindowList& leftWindows, const EffectWindowList& rightWindows,
bool reflectedWindows = false); bool reflectedWindows = false);

View file

@ -36,6 +36,7 @@ DashboardEffect::DashboardEffect()
// read settings // read settings
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
DashboardEffect::~DashboardEffect() DashboardEffect::~DashboardEffect()
@ -188,7 +189,7 @@ void DashboardEffect::slotWindowAdded(EffectWindow* w)
} }
} }
void DashboardEffect::windowClosed(EffectWindow* w) void DashboardEffect::slotWindowClosed(EffectWindow* w)
{ {
propertyNotify(w, atom); propertyNotify(w, atom);

View file

@ -43,10 +43,10 @@ public:
virtual void reconfigure(ReconfigureFlags); virtual void reconfigure(ReconfigureFlags);
virtual void unpropagate(); virtual void unpropagate();
virtual void windowActivated(EffectWindow *w); virtual void windowActivated(EffectWindow *w);
virtual void windowClosed(EffectWindow* c);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* c); void slotWindowAdded(EffectWindow* c);
void slotWindowClosed(EffectWindow *c);
private: private:
bool blur; bool blur;
bool isDashboard(EffectWindow* w); bool isDashboard(EffectWindow* w);

View file

@ -74,6 +74,7 @@ DesktopGridEffect::DesktopGridEffect()
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle())); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle()));
connect(a, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChanged(QKeySequence))); connect(a, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChanged(QKeySequence)));
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
// Load all other configuration details // Load all other configuration details
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
@ -391,7 +392,7 @@ void DesktopGridEffect::slotWindowAdded(EffectWindow* w)
effects->addRepaintFull(); effects->addRepaintFull();
} }
void DesktopGridEffect::windowClosed(EffectWindow* w) void DesktopGridEffect::slotWindowClosed(EffectWindow* w)
{ {
if (!activated && timeline.value() == 0) if (!activated && timeline.value() == 0)
return; return;

View file

@ -71,7 +71,6 @@ public:
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void windowClosed(EffectWindow* w);
virtual void windowDeleted(EffectWindow* w); virtual void windowDeleted(EffectWindow* w);
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old); virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
virtual void windowInputMouseEvent(Window w, QEvent* e); virtual void windowInputMouseEvent(Window w, QEvent* e);
@ -89,6 +88,7 @@ private slots:
void slotAddDesktop(); void slotAddDesktop();
void slotRemoveDesktop(); void slotRemoveDesktop();
void slotWindowAdded(EffectWindow* w); void slotWindowAdded(EffectWindow* w);
void slotWindowClosed(EffectWindow *w);
private: private:
QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const; QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const;

View file

@ -28,6 +28,7 @@ KWIN_EFFECT(dialogparent, DialogParentEffect)
DialogParentEffect::DialogParentEffect() DialogParentEffect::DialogParentEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
void DialogParentEffect::reconfigure(ReconfigureFlags) void DialogParentEffect::reconfigure(ReconfigureFlags)
@ -92,7 +93,7 @@ void DialogParentEffect::windowActivated(EffectWindow* w)
} }
} }
void DialogParentEffect::windowClosed(EffectWindow* w) void DialogParentEffect::slotWindowClosed(EffectWindow* w)
{ {
// If this window is a dialog, we need to repaint it's parent window, so // If this window is a dialog, we need to repaint it's parent window, so
// that the effect could be run for it // that the effect could be run for it

View file

@ -37,6 +37,7 @@ namespace KWin
class DialogParentEffect class DialogParentEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
DialogParentEffect(); DialogParentEffect();
virtual void reconfigure(ReconfigureFlags); virtual void reconfigure(ReconfigureFlags);
@ -45,9 +46,10 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w); virtual void postPaintWindow(EffectWindow* w);
virtual void windowClosed(EffectWindow* c);
virtual void windowActivated(EffectWindow* c); virtual void windowActivated(EffectWindow* c);
public Q_SLOTS:
void slotWindowClosed(EffectWindow *c);
protected: protected:
bool hasModalWindow(EffectWindow* t); bool hasModalWindow(EffectWindow* t);
private: private:

View file

@ -46,6 +46,7 @@ ExplosionEffect::ExplosionEffect() : Effect()
mActiveAnimations = 0; mActiveAnimations = 0;
mValid = true; mValid = true;
mInited = false; mInited = false;
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
ExplosionEffect::~ExplosionEffect() ExplosionEffect::~ExplosionEffect()
@ -180,7 +181,7 @@ void ExplosionEffect::postPaintScreen()
effects->postPaintScreen(); effects->postPaintScreen();
} }
void ExplosionEffect::windowClosed(EffectWindow* c) void ExplosionEffect::slotWindowClosed(EffectWindow* c)
{ {
const void* e = c->data(WindowClosedGrabRole).value<void*>(); const void* e = c->data(WindowClosedGrabRole).value<void*>();
if (e && e != this) if (e && e != this)

View file

@ -38,6 +38,7 @@ class GLTexture;
class ExplosionEffect class ExplosionEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
ExplosionEffect(); ExplosionEffect();
~ExplosionEffect(); ~ExplosionEffect();
@ -47,11 +48,12 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
static bool supported(); static bool supported();
public Q_SLOTS:
void slotWindowClosed(EffectWindow *c);
protected: protected:
bool loadData(); bool loadData();

View file

@ -31,6 +31,7 @@ FadeEffect::FadeEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
void FadeEffect::reconfigure(ReconfigureFlags) void FadeEffect::reconfigure(ReconfigureFlags)
@ -162,7 +163,7 @@ void FadeEffect::slotWindowAdded(EffectWindow* w)
w->addRepaintFull(); w->addRepaintFull();
} }
void FadeEffect::windowClosed(EffectWindow* w) void FadeEffect::slotWindowClosed(EffectWindow* w)
{ {
if (!fadeWindows || !isFadeWindow(w)) if (!fadeWindows || !isFadeWindow(w))
return; return;

View file

@ -39,13 +39,13 @@ public:
// TODO react also on virtual desktop changes // TODO react also on virtual desktop changes
virtual void windowOpacityChanged(EffectWindow* c, double old_opacity); virtual void windowOpacityChanged(EffectWindow* c, double old_opacity);
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
bool isFadeWindow(EffectWindow* w); bool isFadeWindow(EffectWindow* w);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* c); void slotWindowAdded(EffectWindow* c);
void slotWindowClosed(EffectWindow *c);
private: private:
class WindowInfo; class WindowInfo;
QHash< const EffectWindow*, WindowInfo > windows; QHash< const EffectWindow*, WindowInfo > windows;

View file

@ -32,6 +32,7 @@ KWIN_EFFECT(fallapart, FallApartEffect)
FallApartEffect::FallApartEffect() FallApartEffect::FallApartEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
void FallApartEffect::reconfigure(ReconfigureFlags) void FallApartEffect::reconfigure(ReconfigureFlags)
@ -142,7 +143,7 @@ bool FallApartEffect::isRealWindow(EffectWindow* w)
return true; return true;
} }
void FallApartEffect::windowClosed(EffectWindow* c) void FallApartEffect::slotWindowClosed(EffectWindow* c)
{ {
if (!isRealWindow(c)) if (!isRealWindow(c))
return; return;

View file

@ -29,6 +29,7 @@ namespace KWin
class FallApartEffect class FallApartEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
FallApartEffect(); FallApartEffect();
virtual void reconfigure(ReconfigureFlags); virtual void reconfigure(ReconfigureFlags);
@ -36,8 +37,11 @@ public:
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
public Q_SLOTS:
void slotWindowClosed(EffectWindow *c);
private: private:
QHash< const EffectWindow*, double > windows; QHash< const EffectWindow*, double > windows;
bool isRealWindow(EffectWindow* w); bool isRealWindow(EffectWindow* w);

View file

@ -70,6 +70,7 @@ FlipSwitchEffect::FlipSwitchEffect()
connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops())); connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops()));
connect(b, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedAll(QKeySequence))); connect(b, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedAll(QKeySequence)));
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
FlipSwitchEffect::~FlipSwitchEffect() FlipSwitchEffect::~FlipSwitchEffect()
@ -584,7 +585,7 @@ void FlipSwitchEffect::slotWindowAdded(EffectWindow* w)
} }
} }
void FlipSwitchEffect::windowClosed(EffectWindow* w) void FlipSwitchEffect::slotWindowClosed(EffectWindow* w)
{ {
if (m_active && m_windows.contains(w)) { if (m_active && m_windows.contains(w)) {
m_windows.remove(w); m_windows.remove(w);

View file

@ -47,7 +47,6 @@ public:
virtual void tabBoxAdded(int mode); virtual void tabBoxAdded(int mode);
virtual void tabBoxClosed(); virtual void tabBoxClosed();
virtual void tabBoxUpdated(); virtual void tabBoxUpdated();
virtual void windowClosed(EffectWindow* w);
virtual bool borderActivated(ElectricBorder border); virtual bool borderActivated(ElectricBorder border);
virtual void grabbedKeyboardEvent(QKeyEvent* e); virtual void grabbedKeyboardEvent(QKeyEvent* e);
@ -58,6 +57,7 @@ private Q_SLOTS:
void globalShortcutChangedCurrent(QKeySequence shortcut); void globalShortcutChangedCurrent(QKeySequence shortcut);
void globalShortcutChangedAll(QKeySequence shortcut); void globalShortcutChangedAll(QKeySequence shortcut);
void slotWindowAdded(EffectWindow* w); void slotWindowAdded(EffectWindow* w);
void slotWindowClosed(EffectWindow *w);
private: private:
class ItemInfo; class ItemInfo;

View file

@ -38,6 +38,7 @@ GlideEffect::GlideEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
bool GlideEffect::supported() bool GlideEffect::supported()
@ -180,7 +181,7 @@ void GlideEffect::slotWindowAdded(EffectWindow* w)
w->addRepaintFull(); w->addRepaintFull();
} }
void GlideEffect::windowClosed(EffectWindow* w) void GlideEffect::slotWindowClosed(EffectWindow* w)
{ {
if (!isGlideWindow(w)) if (!isGlideWindow(w))
return; return;

View file

@ -40,12 +40,12 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w); virtual void postPaintWindow(EffectWindow* w);
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
static bool supported(); static bool supported();
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* c); void slotWindowAdded(EffectWindow* c);
void slotWindowClosed(EffectWindow *c);
private: private:
class WindowInfo; class WindowInfo;

View file

@ -39,6 +39,7 @@ HighlightWindowEffect::HighlightWindowEffect()
unsigned char dummy = 0; unsigned char dummy = 0;
XChangeProperty(display(), rootWindow(), m_atom, m_atom, 8, PropModeReplace, &dummy, 1); XChangeProperty(display(), rootWindow(), m_atom, m_atom, 8, PropModeReplace, &dummy, 1);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
HighlightWindowEffect::~HighlightWindowEffect() HighlightWindowEffect::~HighlightWindowEffect()
@ -116,7 +117,7 @@ void HighlightWindowEffect::slotWindowAdded(EffectWindow* w)
propertyNotify(w, m_atom); // Check initial value propertyNotify(w, m_atom); // Check initial value
} }
void HighlightWindowEffect::windowClosed(EffectWindow* w) void HighlightWindowEffect::slotWindowClosed(EffectWindow* w)
{ {
if (m_monitorWindow == w) // The monitoring window was destroyed if (m_monitorWindow == w) // The monitoring window was destroyed
finishHighlighting(); finishHighlighting();

View file

@ -37,13 +37,13 @@ public:
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void windowClosed(EffectWindow* w);
virtual void windowDeleted(EffectWindow* w); virtual void windowDeleted(EffectWindow* w);
virtual void propertyNotify(EffectWindow* w, long atom); virtual void propertyNotify(EffectWindow* w, long atom);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* w); void slotWindowAdded(EffectWindow* w);
void slotWindowClosed(EffectWindow *w);
private: private:
void prepareHighlighting(); void prepareHighlighting();

View file

@ -54,6 +54,7 @@ InvertEffect::InvertEffect()
b->setText(i18n("Toggle Invert Effect on Window")); b->setText(i18n("Toggle Invert Effect on Window"));
b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_U)); b->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_U));
connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleWindow())); connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleWindow()));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
InvertEffect::~InvertEffect() InvertEffect::~InvertEffect()
@ -140,7 +141,7 @@ void InvertEffect::paintEffectFrame(KWin::EffectFrame* frame, QRegion region, do
} }
} }
void InvertEffect::windowClosed(EffectWindow* w) void InvertEffect::slotWindowClosed(EffectWindow* w)
{ {
m_windows.removeOne(w); m_windows.removeOne(w);
} }

View file

@ -44,13 +44,13 @@ public:
virtual void prePaintScreen(ScreenPrePaintData &data, int time); virtual void prePaintScreen(ScreenPrePaintData &data, int time);
virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time); virtual void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time);
virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity); virtual void paintEffectFrame(KWin::EffectFrame* frame, QRegion region, double opacity, double frameOpacity);
virtual void windowClosed(EffectWindow* w);
static bool supported(); static bool supported();
public slots: public slots:
void toggle(); void toggle();
void toggleWindow(); void toggleWindow();
void slotWindowClosed(EffectWindow *w);
protected: protected:
bool loadData(); bool loadData();

View file

@ -31,6 +31,7 @@ LoginEffect::LoginEffect()
: progress(1.0) : progress(1.0)
, login_window(NULL) , login_window(NULL)
{ {
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
void LoginEffect::prePaintScreen(ScreenPrePaintData& data, int time) void LoginEffect::prePaintScreen(ScreenPrePaintData& data, int time)
@ -72,7 +73,7 @@ void LoginEffect::postPaintScreen()
effects->postPaintScreen(); effects->postPaintScreen();
} }
void LoginEffect::windowClosed(EffectWindow* w) void LoginEffect::slotWindowClosed(EffectWindow* w)
{ {
if (isLoginSplash(w)) { if (isLoginSplash(w)) {
if (login_window) if (login_window)

View file

@ -30,13 +30,17 @@ namespace KWin
class LoginEffect class LoginEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
LoginEffect(); LoginEffect();
virtual void prePaintScreen(ScreenPrePaintData& data, int time); virtual void prePaintScreen(ScreenPrePaintData& data, int time);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time); virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void windowClosed(EffectWindow* w);
public Q_SLOTS:
void slotWindowClosed(EffectWindow *w);
private: private:
bool isLoginSplash(EffectWindow* w); bool isLoginSplash(EffectWindow* w);
double progress; // 0-1 double progress; // 0-1

View file

@ -61,6 +61,7 @@ LogoutEffect::LogoutEffect()
#endif #endif
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
LogoutEffect::~LogoutEffect() LogoutEffect::~LogoutEffect()
@ -307,7 +308,7 @@ void LogoutEffect::slotWindowAdded(EffectWindow* w)
ignoredWindows.append(w); ignoredWindows.append(w);
} }
void LogoutEffect::windowClosed(EffectWindow* w) void LogoutEffect::slotWindowClosed(EffectWindow* w)
{ {
if (w == logoutWindow) { if (w == logoutWindow) {
logoutWindowClosed = true; logoutWindowClosed = true;

View file

@ -44,11 +44,11 @@ public:
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data); virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void windowClosed(EffectWindow* w);
virtual void windowDeleted(EffectWindow* w); virtual void windowDeleted(EffectWindow* w);
virtual void propertyNotify(EffectWindow* w, long a); virtual void propertyNotify(EffectWindow* w, long a);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* w); void slotWindowAdded(EffectWindow* w);
void slotWindowClosed(EffectWindow *w);
private: private:
bool isLogoutDialog(EffectWindow* w); bool isLogoutDialog(EffectWindow* w);
double progress; // 0-1 double progress; // 0-1

View file

@ -99,6 +99,7 @@ PresentWindowsEffect::PresentWindowsEffect()
shortcutClass = c->globalShortcut(); shortcutClass = c->globalShortcut();
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
PresentWindowsEffect::~PresentWindowsEffect() PresentWindowsEffect::~PresentWindowsEffect()
@ -385,7 +386,7 @@ void PresentWindowsEffect::slotWindowAdded(EffectWindow *w)
} }
} }
void PresentWindowsEffect::windowClosed(EffectWindow *w) void PresentWindowsEffect::slotWindowClosed(EffectWindow *w)
{ {
if (m_managerWindow == w) if (m_managerWindow == w)
m_managerWindow = NULL; m_managerWindow = NULL;

View file

@ -102,7 +102,6 @@ public:
virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data); virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
// User interaction // User interaction
virtual void windowClosed(EffectWindow *w);
virtual void windowDeleted(EffectWindow *w); virtual void windowDeleted(EffectWindow *w);
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old); virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
virtual bool borderActivated(ElectricBorder border); virtual bool borderActivated(ElectricBorder border);
@ -161,6 +160,7 @@ public slots:
void globalShortcutChangedClass(const QKeySequence& seq); void globalShortcutChangedClass(const QKeySequence& seq);
// EffectsHandler // EffectsHandler
void slotWindowAdded(EffectWindow *w); void slotWindowAdded(EffectWindow *w);
void slotWindowClosed(EffectWindow *w);
private slots: private slots:
void closeWindow(); void closeWindow();

View file

@ -29,6 +29,7 @@ ScaleInEffect::ScaleInEffect()
: Effect() : Effect()
{ {
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
void ScaleInEffect::prePaintScreen(ScreenPrePaintData& data, int time) void ScaleInEffect::prePaintScreen(ScreenPrePaintData& data, int time)
@ -88,7 +89,7 @@ void ScaleInEffect::slotWindowAdded(EffectWindow* c)
} }
} }
void ScaleInEffect::windowClosed(EffectWindow* c) void ScaleInEffect::slotWindowClosed(EffectWindow* c)
{ {
mTimeLineWindows.remove(c); mTimeLineWindows.remove(c);
} }

View file

@ -37,9 +37,9 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w); virtual void postPaintWindow(EffectWindow* w);
// TODO react also on virtual desktop changes // TODO react also on virtual desktop changes
virtual void windowClosed(EffectWindow* c);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* c); void slotWindowAdded(EffectWindow* c);
void slotWindowClosed(EffectWindow *c);
private: private:
bool isScaleWindow(EffectWindow* w); bool isScaleWindow(EffectWindow* w);
QHash< const EffectWindow*, TimeLine > mTimeLineWindows; QHash< const EffectWindow*, TimeLine > mTimeLineWindows;

View file

@ -37,6 +37,7 @@ SheetEffect::SheetEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
bool SheetEffect::supported() bool SheetEffect::supported()
@ -141,7 +142,7 @@ void SheetEffect::slotWindowAdded(EffectWindow* w)
w->addRepaintFull(); w->addRepaintFull();
} }
void SheetEffect::windowClosed(EffectWindow* w) void SheetEffect::slotWindowClosed(EffectWindow* w)
{ {
if (!isSheetWindow(w)) if (!isSheetWindow(w))
return; return;

View file

@ -39,13 +39,13 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w); virtual void postPaintWindow(EffectWindow* w);
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
static bool supported(); static bool supported();
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow* c); void slotWindowAdded(EffectWindow* c);
void slotWindowClosed(EffectWindow *c);
private: private:
class WindowInfo; class WindowInfo;
typedef QMap< const EffectWindow*, WindowInfo > InfoMap; typedef QMap< const EffectWindow*, WindowInfo > InfoMap;

View file

@ -39,6 +39,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
unsigned char dummy = 0; unsigned char dummy = 0;
XChangeProperty(display(), rootWindow(), mAtom, mAtom, 8, PropModeReplace, &dummy, 1); XChangeProperty(display(), rootWindow(), mAtom, mAtom, 8, PropModeReplace, &dummy, 1);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
SlidingPopupsEffect::~SlidingPopupsEffect() SlidingPopupsEffect::~SlidingPopupsEffect()
@ -147,7 +148,7 @@ void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w)
} }
} }
void SlidingPopupsEffect::windowClosed(EffectWindow* w) void SlidingPopupsEffect::slotWindowClosed(EffectWindow* w)
{ {
propertyNotify(w, mAtom); propertyNotify(w, mAtom);
if (w->isOnCurrentDesktop() && !w->isMinimized() && mWindowsData.contains(w)) { if (w->isOnCurrentDesktop() && !w->isMinimized() && mWindowsData.contains(w)) {

View file

@ -39,12 +39,12 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintWindow(EffectWindow* w); virtual void postPaintWindow(EffectWindow* w);
// TODO react also on virtual desktop changes // TODO react also on virtual desktop changes
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
virtual void propertyNotify(EffectWindow* w, long a); virtual void propertyNotify(EffectWindow* w, long a);
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow *c); void slotWindowAdded(EffectWindow *c);
void slotWindowClosed(EffectWindow *c);
private: private:
enum Position { enum Position {
West = 0, West = 0,

View file

@ -35,6 +35,7 @@ SnapHelperEffect::SnapHelperEffect()
{ {
m_timeline.setCurveShape(TimeLine::LinearCurve); m_timeline.setCurveShape(TimeLine::LinearCurve);
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
/*if ( effects->compositingType() == XRenderCompositing ) /*if ( effects->compositingType() == XRenderCompositing )
{ {
@ -187,7 +188,7 @@ void SnapHelperEffect::postPaintScreen()
} }
} }
void SnapHelperEffect::windowClosed(EffectWindow* w) void SnapHelperEffect::slotWindowClosed(EffectWindow* w)
{ {
if (m_window == w) { if (m_window == w) {
m_window->refWindow(); m_window->refWindow();

View file

@ -29,6 +29,7 @@ namespace KWin
class SnapHelperEffect class SnapHelperEffect
: public Effect : public Effect
{ {
Q_OBJECT
public: public:
SnapHelperEffect(); SnapHelperEffect();
~SnapHelperEffect(); ~SnapHelperEffect();
@ -37,11 +38,13 @@ public:
virtual void prePaintScreen(ScreenPrePaintData &data, int time); virtual void prePaintScreen(ScreenPrePaintData &data, int time);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void windowClosed(EffectWindow* w);
virtual void windowUserMovedResized(EffectWindow* w, bool first, bool last); virtual void windowUserMovedResized(EffectWindow* w, bool first, bool last);
static bool supported(); static bool supported();
public Q_SLOTS:
void slotWindowClosed(EffectWindow *w);
private: private:
bool m_active; bool m_active;
EffectWindow* m_window; EffectWindow* m_window;

View file

@ -38,6 +38,7 @@ ThumbnailAsideEffect::ThumbnailAsideEffect()
a->setText(i18n("Toggle Thumbnail for Current Window")); a->setText(i18n("Toggle Thumbnail for Current Window"));
a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_T)); a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_T));
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleCurrentThumbnail())); connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleCurrentThumbnail()));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
} }
@ -87,7 +88,7 @@ void ThumbnailAsideEffect::windowGeometryShapeChanged(EffectWindow* w, const QRe
} }
} }
void ThumbnailAsideEffect::windowClosed(EffectWindow* w) void ThumbnailAsideEffect::slotWindowClosed(EffectWindow* w)
{ {
removeThumbnail(w); removeThumbnail(w);
} }

View file

@ -45,9 +45,9 @@ public:
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data); virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
virtual void windowDamaged(EffectWindow* w, const QRect& damage); virtual void windowDamaged(EffectWindow* w, const QRect& damage);
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old); virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
virtual void windowClosed(EffectWindow* w);
private slots: private slots:
void toggleCurrentThumbnail(); void toggleCurrentThumbnail();
void slotWindowClosed(EffectWindow *w);
private: private:
void addThumbnail(EffectWindow* w); void addThumbnail(EffectWindow* w);
void removeThumbnail(EffectWindow* w); void removeThumbnail(EffectWindow* w);

View file

@ -166,6 +166,7 @@ WobblyWindowsEffect::WobblyWindowsEffect()
{ {
reconfigure(ReconfigureAll); reconfigure(ReconfigureAll);
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*))); connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
connect(effects, SIGNAL(windowClosed(EffectWindow*)), this, SLOT(slotWindowClosed(EffectWindow*)));
} }
WobblyWindowsEffect::~WobblyWindowsEffect() WobblyWindowsEffect::~WobblyWindowsEffect()
@ -477,7 +478,7 @@ void WobblyWindowsEffect::slotWindowAdded(EffectWindow* w)
} }
} }
void WobblyWindowsEffect::windowClosed(EffectWindow* w) void WobblyWindowsEffect::slotWindowClosed(EffectWindow* w)
{ {
if (windows.contains(w)) { if (windows.contains(w)) {
WindowWobblyInfos& wwi = windows[w]; WindowWobblyInfos& wwi = windows[w];

View file

@ -36,7 +36,6 @@ public:
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data); virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
virtual void postPaintScreen(); virtual void postPaintScreen();
virtual void windowUserMovedResized(EffectWindow* c, bool first, bool last); virtual void windowUserMovedResized(EffectWindow* c, bool first, bool last);
virtual void windowClosed(EffectWindow* w);
// Wobbly model parameters // Wobbly model parameters
void setStiffness(qreal stiffness); void setStiffness(qreal stiffness);
@ -60,6 +59,7 @@ public:
public Q_SLOTS: public Q_SLOTS:
void slotWindowAdded(EffectWindow *w); void slotWindowAdded(EffectWindow *w);
void slotWindowClosed(EffectWindow *w);
private: private:

View file

@ -131,10 +131,6 @@ void Effect::windowOpacityChanged(EffectWindow*, double)
{ {
} }
void Effect::windowClosed(EffectWindow*)
{
}
void Effect::windowDeleted(EffectWindow*) void Effect::windowDeleted(EffectWindow*)
{ {
} }

View file

@ -445,7 +445,6 @@ public:
/** called when the geometry changed during moving/resizing. */ /** called when the geometry changed during moving/resizing. */
virtual void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry); virtual void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
virtual void windowOpacityChanged(EffectWindow* c, double old_opacity); virtual void windowOpacityChanged(EffectWindow* c, double old_opacity);
virtual void windowClosed(EffectWindow* c);
virtual void windowDeleted(EffectWindow* c); virtual void windowDeleted(EffectWindow* c);
virtual void windowActivated(EffectWindow* c); virtual void windowActivated(EffectWindow* c);
virtual void windowMinimized(EffectWindow* c); virtual void windowMinimized(EffectWindow* c);
@ -844,6 +843,15 @@ Q_SIGNALS:
* @since 4.7 * @since 4.7
**/ **/
void windowAdded(EffectWindow *w); void windowAdded(EffectWindow *w);
/**
* Signal emitted when a window is being removed from the Workspace.
* An effect which wants to animate the window closing should connect
* to this signal and reference the window by using
* @link EffectWindow::refWindow
* @param w The window which is being closed
* @since 4.7
**/
void windowClosed(EffectWindow *w);
protected: protected:
QVector< EffectPair > loaded_effects; QVector< EffectPair > loaded_effects;

View file

@ -81,8 +81,8 @@ bool Unmanaged::track(Window w)
void Unmanaged::release() void Unmanaged::release()
{ {
Deleted* del = Deleted::create(this); Deleted* del = Deleted::create(this);
if (effects) { emit unmanagedClosed(this);
static_cast<EffectsHandlerImpl*>(effects)->windowClosed(effectWindow()); if (scene) {
scene->windowClosed(this, del); scene->windowClosed(this, del);
} }
finishCompositing(); finishCompositing();

View file

@ -46,6 +46,8 @@ public:
protected: protected:
virtual void debug(QDebug& stream) const; virtual void debug(QDebug& stream) const;
virtual bool shouldUnredirect() const; virtual bool shouldUnredirect() const;
Q_SIGNALS:
void unmanagedClosed(KWin::Unmanaged*);
private: private:
virtual ~Unmanaged(); // use release() virtual ~Unmanaged(); // use release()
// handlers for X11 events // handlers for X11 events

View file

@ -180,6 +180,19 @@ public:
void reserveElectricBorderActions(bool reserve); void reserveElectricBorderActions(bool reserve);
void reserveElectricBorderSwitching(bool reserve); void reserveElectricBorderSwitching(bool reserve);
/**
* @return List of clients currently managed by Workspace
**/
const ClientList &clientList() const {
return clients;
}
/**
* @return List of unmanaged "clients" currently registered in Workspace
**/
const UnmanagedList &unmanagedList() const {
return unmanaged;
}
//------------------------------------------------- //-------------------------------------------------
// Tiling // Tiling
public: public: