ClientGroupItem* become signals

This needs to be improved in core. Currently ClientGroup does not yet
emit signals, as it would be difficult to connect them. Nevertheless
the effects dependency should be removed.
This commit is contained in:
Martin Gräßlin 2011-03-06 21:15:09 +01:00
parent 747afb4225
commit dcebc7481b
7 changed files with 18 additions and 33 deletions

View file

@ -110,7 +110,7 @@ void ClientGroup::add(Client* c, int before, bool becomeVisible)
// Notify effects of merge
if (effects != NULL)
static_cast<EffectsHandlerImpl*>(effects)->clientGroupItemAdded(
static_cast<EffectsHandlerImpl*>(effects)->slotClientGroupItemAdded(
c->effectWindow(), clients_[visible_]->effectWindow());
// Actually remove from old group if required and update
@ -165,7 +165,7 @@ void ClientGroup::remove(Client* c, const QRect& newGeom, bool toNullGroup)
// Notify effects of removal
if (effects)
static_cast<EffectsHandlerImpl*>(effects)->clientGroupItemRemoved(
static_cast<EffectsHandlerImpl*>(effects)->slotClientGroupItemRemoved(
c->effectWindow(), newVisible->effectWindow());
setVisible(newVisible); // Display new window before removing old one
@ -258,7 +258,7 @@ void ClientGroup::setVisible(Client* c)
// Notify effects of switch
if (effects != NULL)
static_cast<EffectsHandlerImpl*>(effects)->clientGroupItemSwitched(
static_cast<EffectsHandlerImpl*>(effects)->slotClientGroupItemSwitched(
clients_[visible_]->effectWindow(), c->effectWindow());
visible_ = indexOfClient(c);

View file

@ -364,22 +364,19 @@ void EffectsHandlerImpl::slotClientUnminimized(Client* c, bool animate)
}
}
void EffectsHandlerImpl::clientGroupItemSwitched(EffectWindow* from, EffectWindow* to)
void EffectsHandlerImpl::slotClientGroupItemSwitched(EffectWindow* from, EffectWindow* to)
{
foreach (const EffectPair & ep, loaded_effects)
ep.second->clientGroupItemSwitched(from, to);
emit clientGroupItemSwitched(from, to);
}
void EffectsHandlerImpl::clientGroupItemAdded(EffectWindow* from, EffectWindow* to)
void EffectsHandlerImpl::slotClientGroupItemAdded(EffectWindow* from, EffectWindow* to)
{
foreach (const EffectPair & ep, loaded_effects)
ep.second->clientGroupItemAdded(from, to);
emit clientGroupItemAdded(from, to);
}
void EffectsHandlerImpl::clientGroupItemRemoved(EffectWindow* c, EffectWindow* group)
void EffectsHandlerImpl::slotClientGroupItemRemoved(EffectWindow* c, EffectWindow* group)
{
foreach (const EffectPair & ep, loaded_effects)
ep.second->clientGroupItemRemoved(c, group);
emit clientGroupItemRemoved(c, group);
}
void EffectsHandlerImpl::slotDesktopChanged(int old)

View file

@ -159,9 +159,6 @@ public:
// internal (used by kwin core or compositing code)
void startPaint();
void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
void clientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
void clientGroupItemAdded(EffectWindow* from, EffectWindow* to);
void clientGroupItemRemoved(EffectWindow* c, EffectWindow* group);
void windowDamaged(EffectWindow* w, const QRect& r);
void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
bool borderActivated(ElectricBorder border);
@ -184,6 +181,9 @@ public:
public Q_SLOTS:
void slotWindowUserMovedResized(EffectWindow* c, bool first, bool last);
void slotClientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
void slotClientGroupItemAdded(EffectWindow* from, EffectWindow* to);
void slotClientGroupItemRemoved(EffectWindow* c, EffectWindow* group);
protected Q_SLOTS:
void slotDesktopChanged(int old);

View file

@ -37,6 +37,7 @@ SlideBackEffect::SlideBackEffect()
connect(effects, SIGNAL(windowActivated(EffectWindow*)), this, SLOT(slotWindowActivated(EffectWindow*)));
connect(effects, SIGNAL(windowDeleted(EffectWindow*)), this, SLOT(slotWindowDeleted(EffectWindow*)));
connect(effects, SIGNAL(windowUnminimized(EffectWindow*)), this, SLOT(slotWindowUnminimized(EffectWindow*)));
connect(effects, SIGNAL(clientGroupItemSwitched(EffectWindow*,EffectWindow*)), this, SLOT(slotClientGroupItemSwitched(EffectWindow*,EffectWindow*)));
}
static inline bool windowsShareDesktop(EffectWindow *w1, EffectWindow *w2)
@ -309,7 +310,7 @@ void SlideBackEffect::slotWindowUnminimized(EffectWindow* w)
}
}
void SlideBackEffect::clientGroupItemSwitched(EffectWindow* from, EffectWindow* to)
void SlideBackEffect::slotClientGroupItemSwitched(EffectWindow* from, EffectWindow* to)
{
clientItemShown = to;
clientItemHidden = from;

View file

@ -41,8 +41,6 @@ public:
virtual void prePaintScreen(ScreenPrePaintData &data, int time);
virtual void postPaintScreen();
virtual void clientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
virtual void tabBoxClosed();
public Q_SLOTS:
@ -50,6 +48,7 @@ public Q_SLOTS:
void slotWindowActivated(EffectWindow *w);
void slotWindowDeleted(EffectWindow *w);
void slotWindowUnminimized(EffectWindow *w);
void slotClientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
private:

View file

@ -123,18 +123,6 @@ void Effect::windowMoveResizeGeometryUpdate(EffectWindow* , const QRect&)
{
}
void Effect::clientGroupItemSwitched(EffectWindow*, EffectWindow*)
{
}
void Effect::clientGroupItemAdded(EffectWindow*, EffectWindow*)
{
}
void Effect::clientGroupItemRemoved(EffectWindow*, EffectWindow*)
{
}
void Effect::windowInputMouseEvent(Window, QEvent*)
{
}

View file

@ -442,9 +442,6 @@ public:
/** called when the geometry changed during moving/resizing. */
virtual void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
virtual void clientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
virtual void clientGroupItemAdded(EffectWindow* from, EffectWindow* to); // from merged with to
virtual void clientGroupItemRemoved(EffectWindow* c, EffectWindow* group); // c removed from group
virtual void windowInputMouseEvent(Window w, QEvent* e);
virtual void windowDamaged(EffectWindow* w, const QRect& r);
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
@ -926,6 +923,9 @@ Q_SIGNALS:
* @since 4.7
**/
void tabBoxKeyEvent(QKeyEvent* event);
void clientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
void clientGroupItemAdded(EffectWindow* from, EffectWindow* to); // from merged with to
void clientGroupItemRemoved(EffectWindow* c, EffectWindow* group); // c removed from group
protected:
QVector< EffectPair > loaded_effects;