EffectsHandler emits windowAdded signal
All previously existing windowAdded methods are renamed to slotWindowAdded. EffectsHandlerImpl is connected to Workspace's clientAdded signal, which is emitted a little bit earlier than the previous direct method call. This might change behavior. Another signal is added to Workspace to signal that an unmanaged is added.
This commit is contained in:
parent
c3a076b6a5
commit
ab6f2ba1fd
36 changed files with 109 additions and 44 deletions
12
effects.cpp
12
effects.cpp
|
@ -97,6 +97,8 @@ EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type)
|
|||
{
|
||||
Workspace *ws = Workspace::self();
|
||||
connect(ws, SIGNAL(currentDesktopChanged(int)), this, SLOT(slotDesktopChanged(int)));
|
||||
connect(ws, SIGNAL(clientAdded(KWin::Client*)), this, SLOT(slotClientAdded(KWin::Client*)));
|
||||
connect(ws, SIGNAL(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(slotUnmanagedAdded(KWin::Unmanaged*)));
|
||||
reconfigure();
|
||||
}
|
||||
|
||||
|
@ -281,10 +283,14 @@ void EffectsHandlerImpl::windowOpacityChanged(EffectWindow* c, double old_opacit
|
|||
ep.second->windowOpacityChanged(c, old_opacity);
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::windowAdded(EffectWindow* c)
|
||||
void EffectsHandlerImpl::slotClientAdded(Client *c)
|
||||
{
|
||||
foreach (const EffectPair & ep, loaded_effects)
|
||||
ep.second->windowAdded(c);
|
||||
emit windowAdded(c->effectWindow());
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::slotUnmanagedAdded(Unmanaged *u)
|
||||
{
|
||||
emit windowAdded(u->effectWindow());
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::windowDeleted(EffectWindow* c)
|
||||
|
|
|
@ -36,6 +36,9 @@ class KService;
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
class Client;
|
||||
class Unmanaged;
|
||||
|
||||
class EffectsHandlerImpl : public EffectsHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -157,7 +160,6 @@ public:
|
|||
void windowUserMovedResized(EffectWindow* c, bool first, bool last);
|
||||
void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
|
||||
void windowOpacityChanged(EffectWindow* c, double old_opacity);
|
||||
void windowAdded(EffectWindow* c);
|
||||
void windowClosed(EffectWindow* c);
|
||||
void windowDeleted(EffectWindow* c);
|
||||
void windowActivated(EffectWindow* c);
|
||||
|
@ -193,6 +195,8 @@ public:
|
|||
|
||||
protected Q_SLOTS:
|
||||
void slotDesktopChanged(int old);
|
||||
void slotClientAdded(KWin::Client *c);
|
||||
void slotUnmanagedAdded(KWin::Unmanaged *u);
|
||||
|
||||
protected:
|
||||
KLibrary* findEffectLibrary(KService* service);
|
||||
|
|
|
@ -57,6 +57,7 @@ BlurEffect::BlurEffect()
|
|||
} else {
|
||||
XDeleteProperty(display(), rootWindow(), net_wm_blur_region);
|
||||
}
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
BlurEffect::~BlurEffect()
|
||||
|
@ -106,7 +107,7 @@ void BlurEffect::updateBlurRegion(EffectWindow *w) const
|
|||
w->setData(WindowBlurBehindRole, region);
|
||||
}
|
||||
|
||||
void BlurEffect::windowAdded(EffectWindow *w)
|
||||
void BlurEffect::slotWindowAdded(EffectWindow *w)
|
||||
{
|
||||
updateBlurRegion(w);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ class BlurShader;
|
|||
|
||||
class BlurEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BlurEffect();
|
||||
~BlurEffect();
|
||||
|
@ -40,12 +41,14 @@ public:
|
|||
static bool supported();
|
||||
|
||||
void reconfigure(ReconfigureFlags flags);
|
||||
void windowAdded(EffectWindow *w);
|
||||
void propertyNotify(EffectWindow *w, long atom);
|
||||
void paintScreen(int mask, QRegion region, ScreenPaintData &data);
|
||||
void drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
|
||||
void paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow *w);
|
||||
|
||||
private:
|
||||
QRect expand(const QRect &rect) const;
|
||||
QRegion expand(const QRegion ®ion) const;
|
||||
|
|
|
@ -35,6 +35,7 @@ DashboardEffect::DashboardEffect()
|
|||
|
||||
// read settings
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
DashboardEffect::~DashboardEffect()
|
||||
|
@ -171,7 +172,7 @@ void DashboardEffect::windowActivated(EffectWindow *w)
|
|||
}
|
||||
}
|
||||
|
||||
void DashboardEffect::windowAdded(EffectWindow* w)
|
||||
void DashboardEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
propertyNotify(w, atom);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace KWin
|
|||
|
||||
class DashboardEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DashboardEffect();
|
||||
~DashboardEffect();
|
||||
|
@ -42,8 +43,10 @@ public:
|
|||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void unpropagate();
|
||||
virtual void windowActivated(EffectWindow *w);
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* c);
|
||||
private:
|
||||
bool blur;
|
||||
bool isDashboard(EffectWindow* w);
|
||||
|
|
|
@ -73,6 +73,7 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
shortcut = a->globalShortcut();
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggle()));
|
||||
connect(a, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChanged(QKeySequence)));
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
|
||||
// Load all other configuration details
|
||||
reconfigure(ReconfigureAll);
|
||||
|
@ -368,7 +369,7 @@ void DesktopGridEffect::paintWindow(EffectWindow* w, int mask, QRegion region, W
|
|||
//-----------------------------------------------------------------------------
|
||||
// User interaction
|
||||
|
||||
void DesktopGridEffect::windowAdded(EffectWindow* w)
|
||||
void DesktopGridEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (!activated)
|
||||
return;
|
||||
|
|
|
@ -73,7 +73,6 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void windowClosed(EffectWindow* w);
|
||||
virtual void windowDeleted(EffectWindow* w);
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
|
||||
virtual void windowInputMouseEvent(Window w, QEvent* e);
|
||||
virtual void grabbedKeyboardEvent(QKeyEvent* e);
|
||||
|
@ -89,6 +88,7 @@ private slots:
|
|||
void globalShortcutChanged(const QKeySequence& seq);
|
||||
void slotAddDesktop();
|
||||
void slotRemoveDesktop();
|
||||
void slotWindowAdded(EffectWindow* w);
|
||||
|
||||
private:
|
||||
QPointF scalePos(const QPoint& pos, int desktop, int screen = -1) const;
|
||||
|
|
|
@ -30,6 +30,7 @@ KWIN_EFFECT(fade, FadeEffect)
|
|||
FadeEffect::FadeEffect()
|
||||
{
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
void FadeEffect::reconfigure(ReconfigureFlags)
|
||||
|
@ -153,7 +154,7 @@ void FadeEffect::windowOpacityChanged(EffectWindow* w, double old_opacity)
|
|||
w->addRepaintFull();
|
||||
}
|
||||
|
||||
void FadeEffect::windowAdded(EffectWindow* w)
|
||||
void FadeEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (!fadeWindows || !isFadeWindow(w))
|
||||
return;
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace KWin
|
|||
class FadeEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FadeEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -38,11 +39,13 @@ public:
|
|||
|
||||
// TODO react also on virtual desktop changes
|
||||
virtual void windowOpacityChanged(EffectWindow* c, double old_opacity);
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
virtual void windowDeleted(EffectWindow* c);
|
||||
|
||||
bool isFadeWindow(EffectWindow* w);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* c);
|
||||
private:
|
||||
class WindowInfo;
|
||||
QHash< const EffectWindow*, WindowInfo > windows;
|
||||
|
|
|
@ -69,6 +69,7 @@ FlipSwitchEffect::FlipSwitchEffect()
|
|||
m_shortcutAll = b->globalShortcut();
|
||||
connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops()));
|
||||
connect(b, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedAll(QKeySequence)));
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
FlipSwitchEffect::~FlipSwitchEffect()
|
||||
|
@ -576,7 +577,7 @@ void FlipSwitchEffect::tabBoxUpdated()
|
|||
// Window adding/removing handling
|
||||
//*************************************************************
|
||||
|
||||
void FlipSwitchEffect::windowAdded(EffectWindow* w)
|
||||
void FlipSwitchEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (m_active && isSelectableWindow(w)) {
|
||||
m_windows[ w ] = new ItemInfo();
|
||||
|
|
|
@ -47,7 +47,6 @@ public:
|
|||
virtual void tabBoxAdded(int mode);
|
||||
virtual void tabBoxClosed();
|
||||
virtual void tabBoxUpdated();
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowClosed(EffectWindow* w);
|
||||
virtual bool borderActivated(ElectricBorder border);
|
||||
virtual void grabbedKeyboardEvent(QKeyEvent* e);
|
||||
|
@ -58,6 +57,7 @@ private Q_SLOTS:
|
|||
void toggleActiveAllDesktops();
|
||||
void globalShortcutChangedCurrent(QKeySequence shortcut);
|
||||
void globalShortcutChangedAll(QKeySequence shortcut);
|
||||
void slotWindowAdded(EffectWindow* w);
|
||||
|
||||
private:
|
||||
class ItemInfo;
|
||||
|
|
|
@ -37,6 +37,7 @@ static const int IsGlideWindow = 0x22A982D4;
|
|||
GlideEffect::GlideEffect()
|
||||
{
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
bool GlideEffect::supported()
|
||||
|
@ -159,7 +160,7 @@ void GlideEffect::postPaintWindow(EffectWindow* w)
|
|||
effects->postPaintWindow(w);
|
||||
}
|
||||
|
||||
void GlideEffect::windowAdded(EffectWindow* w)
|
||||
void GlideEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (!isGlideWindow(w))
|
||||
return;
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace KWin
|
|||
class GlideEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GlideEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -39,11 +40,13 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintWindow(EffectWindow* w);
|
||||
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
virtual void windowDeleted(EffectWindow* c);
|
||||
|
||||
static bool supported();
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* c);
|
||||
|
||||
private:
|
||||
class WindowInfo;
|
||||
typedef QMap< const EffectWindow*, WindowInfo > InfoHash;
|
||||
|
|
|
@ -38,6 +38,7 @@ HighlightWindowEffect::HighlightWindowEffect()
|
|||
// Announce support by creating a dummy version on the root window
|
||||
unsigned char dummy = 0;
|
||||
XChangeProperty(display(), rootWindow(), m_atom, m_atom, 8, PropModeReplace, &dummy, 1);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
HighlightWindowEffect::~HighlightWindowEffect()
|
||||
|
@ -103,7 +104,7 @@ void HighlightWindowEffect::paintWindow(EffectWindow* w, int mask, QRegion regio
|
|||
effects->paintWindow(w, mask, region, data);
|
||||
}
|
||||
|
||||
void HighlightWindowEffect::windowAdded(EffectWindow* w)
|
||||
void HighlightWindowEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (!m_highlightedWindows.isEmpty()) {
|
||||
// The effect is activated thus we need to add it to the opacity hash
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace KWin
|
|||
class HighlightWindowEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
HighlightWindowEffect();
|
||||
virtual ~HighlightWindowEffect();
|
||||
|
@ -36,12 +37,14 @@ public:
|
|||
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowClosed(EffectWindow* w);
|
||||
virtual void windowDeleted(EffectWindow* w);
|
||||
|
||||
virtual void propertyNotify(EffectWindow* w, long atom);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* w);
|
||||
|
||||
private:
|
||||
void prepareHighlighting();
|
||||
void finishHighlighting();
|
||||
|
|
|
@ -60,6 +60,7 @@ LogoutEffect::LogoutEffect()
|
|||
blurTarget = NULL;
|
||||
#endif
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
LogoutEffect::~LogoutEffect()
|
||||
|
@ -292,7 +293,7 @@ void LogoutEffect::postPaintScreen()
|
|||
effects->postPaintScreen();
|
||||
}
|
||||
|
||||
void LogoutEffect::windowAdded(EffectWindow* w)
|
||||
void LogoutEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (isLogoutDialog(w)) {
|
||||
logoutWindow = w;
|
||||
|
|
|
@ -35,6 +35,7 @@ class GLTexture;
|
|||
class LogoutEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LogoutEffect();
|
||||
~LogoutEffect();
|
||||
|
@ -43,10 +44,11 @@ public:
|
|||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowClosed(EffectWindow* w);
|
||||
virtual void windowDeleted(EffectWindow* w);
|
||||
virtual void propertyNotify(EffectWindow* w, long a);
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* w);
|
||||
private:
|
||||
bool isLogoutDialog(EffectWindow* w);
|
||||
double progress; // 0-1
|
||||
|
|
|
@ -98,6 +98,7 @@ PresentWindowsEffect::PresentWindowsEffect()
|
|||
connect(c, SIGNAL(globalShortcutChanged(QKeySequence)), this, SLOT(globalShortcutChangedClass(QKeySequence)));
|
||||
shortcutClass = c->globalShortcut();
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
PresentWindowsEffect::~PresentWindowsEffect()
|
||||
|
@ -357,7 +358,7 @@ void PresentWindowsEffect::paintWindow(EffectWindow *w, int mask, QRegion region
|
|||
//-----------------------------------------------------------------------------
|
||||
// User interaction
|
||||
|
||||
void PresentWindowsEffect::windowAdded(EffectWindow *w)
|
||||
void PresentWindowsEffect::slotWindowAdded(EffectWindow *w)
|
||||
{
|
||||
if (!m_activated)
|
||||
return;
|
||||
|
|
|
@ -102,7 +102,6 @@ public:
|
|||
virtual void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
|
||||
|
||||
// User interaction
|
||||
virtual void windowAdded(EffectWindow *w);
|
||||
virtual void windowClosed(EffectWindow *w);
|
||||
virtual void windowDeleted(EffectWindow *w);
|
||||
virtual void windowGeometryShapeChanged(EffectWindow* w, const QRect& old);
|
||||
|
@ -160,6 +159,8 @@ public slots:
|
|||
void globalShortcutChanged(const QKeySequence& seq);
|
||||
void globalShortcutChangedAll(const QKeySequence& seq);
|
||||
void globalShortcutChangedClass(const QKeySequence& seq);
|
||||
// EffectsHandler
|
||||
void slotWindowAdded(EffectWindow *w);
|
||||
|
||||
private slots:
|
||||
void closeWindow();
|
||||
|
|
|
@ -25,6 +25,12 @@ namespace KWin
|
|||
|
||||
KWIN_EFFECT(scalein, ScaleInEffect)
|
||||
|
||||
ScaleInEffect::ScaleInEffect()
|
||||
: Effect()
|
||||
{
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
void ScaleInEffect::prePaintScreen(ScreenPrePaintData& data, int time)
|
||||
{
|
||||
if (!mTimeLineWindows.isEmpty())
|
||||
|
@ -73,7 +79,7 @@ void ScaleInEffect::postPaintWindow(EffectWindow* w)
|
|||
effects->postPaintWindow(w);
|
||||
}
|
||||
|
||||
void ScaleInEffect::windowAdded(EffectWindow* c)
|
||||
void ScaleInEffect::slotWindowAdded(EffectWindow* c)
|
||||
{
|
||||
if (c->isOnCurrentDesktop()) {
|
||||
mTimeLineWindows[ c ].setDuration(animationTime(250));
|
||||
|
|
|
@ -29,14 +29,17 @@ namespace KWin
|
|||
class ScaleInEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScaleInEffect();
|
||||
virtual void prePaintScreen(ScreenPrePaintData& 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 postPaintWindow(EffectWindow* w);
|
||||
// TODO react also on virtual desktop changes
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* c);
|
||||
private:
|
||||
bool isScaleWindow(EffectWindow* w);
|
||||
QHash< const EffectWindow*, TimeLine > mTimeLineWindows;
|
||||
|
|
|
@ -36,6 +36,7 @@ static const int IsSheetWindow = 0x22A982D5;
|
|||
SheetEffect::SheetEffect()
|
||||
{
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
bool SheetEffect::supported()
|
||||
|
@ -117,7 +118,7 @@ void SheetEffect::postPaintWindow(EffectWindow* w)
|
|||
effects->postPaintWindow(w);
|
||||
}
|
||||
|
||||
void SheetEffect::windowAdded(EffectWindow* w)
|
||||
void SheetEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (!isSheetWindow(w))
|
||||
return;
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace KWin
|
|||
class SheetEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SheetEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -38,11 +39,13 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintWindow(EffectWindow* w);
|
||||
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
virtual void windowDeleted(EffectWindow* c);
|
||||
|
||||
static bool supported();
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow* c);
|
||||
private:
|
||||
class WindowInfo;
|
||||
typedef QMap< const EffectWindow*, WindowInfo > InfoMap;
|
||||
|
|
|
@ -33,6 +33,7 @@ SlideBackEffect::SlideBackEffect()
|
|||
updateStackingOrder();
|
||||
disabled = false;
|
||||
unminimizedWindow = NULL;
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
static inline bool windowsShareDesktop(EffectWindow *w1, EffectWindow *w2)
|
||||
|
@ -287,7 +288,7 @@ void SlideBackEffect::windowDeleted(EffectWindow* w)
|
|||
}
|
||||
}
|
||||
|
||||
void SlideBackEffect::windowAdded(KWin::EffectWindow* w)
|
||||
void SlideBackEffect::slotWindowAdded(EffectWindow *w)
|
||||
{
|
||||
Q_UNUSED(w);
|
||||
updateStackingOrder();
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace KWin
|
|||
class SlideBackEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SlideBackEffect();
|
||||
|
||||
|
@ -43,12 +44,14 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
|
||||
virtual void windowDeleted(EffectWindow* w);
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowUnminimized(EffectWindow* w);
|
||||
virtual void clientGroupItemSwitched(EffectWindow* from, EffectWindow* to);
|
||||
|
||||
virtual void tabBoxClosed();
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow *w);
|
||||
|
||||
private:
|
||||
|
||||
WindowMotionManager motionManager;
|
||||
|
|
|
@ -38,6 +38,7 @@ SlidingPopupsEffect::SlidingPopupsEffect()
|
|||
// TODO hackish way to announce support, make better after 4.0
|
||||
unsigned char dummy = 0;
|
||||
XChangeProperty(display(), rootWindow(), mAtom, mAtom, 8, PropModeReplace, &dummy, 1);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
SlidingPopupsEffect::~SlidingPopupsEffect()
|
||||
|
@ -131,7 +132,7 @@ void SlidingPopupsEffect::postPaintWindow(EffectWindow* w)
|
|||
}
|
||||
}
|
||||
|
||||
void SlidingPopupsEffect::windowAdded(EffectWindow* w)
|
||||
void SlidingPopupsEffect::slotWindowAdded(EffectWindow *w)
|
||||
{
|
||||
propertyNotify(w, mAtom);
|
||||
if (w->isOnCurrentDesktop() && mWindowsData.contains(w)) {
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace KWin
|
|||
class SlidingPopupsEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SlidingPopupsEffect();
|
||||
~SlidingPopupsEffect();
|
||||
|
@ -38,10 +39,12 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintWindow(EffectWindow* w);
|
||||
// TODO react also on virtual desktop changes
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
virtual void windowDeleted(EffectWindow* c);
|
||||
virtual void propertyNotify(EffectWindow* w, long a);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow *c);
|
||||
private:
|
||||
enum Position {
|
||||
West = 0,
|
||||
|
|
|
@ -43,6 +43,7 @@ TaskbarThumbnailEffect::TaskbarThumbnailEffect()
|
|||
// TODO hackish way to announce support, make better after 4.0
|
||||
unsigned char dummy = 0;
|
||||
XChangeProperty(display(), rootWindow(), atom, atom, 8, PropModeReplace, &dummy, 1);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
TaskbarThumbnailEffect::~TaskbarThumbnailEffect()
|
||||
|
@ -118,7 +119,7 @@ void TaskbarThumbnailEffect::windowDamaged(EffectWindow* w, const QRect& damage)
|
|||
effects->addRepaint(thumb.rect.translated(window->pos()));
|
||||
}
|
||||
|
||||
void TaskbarThumbnailEffect::windowAdded(EffectWindow* w)
|
||||
void TaskbarThumbnailEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
propertyNotify(w, atom); // read initial value
|
||||
}
|
||||
|
|
|
@ -29,8 +29,9 @@ namespace KWin
|
|||
{
|
||||
|
||||
class TaskbarThumbnailEffect
|
||||
: public QObject, public Effect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TaskbarThumbnailEffect();
|
||||
virtual ~TaskbarThumbnailEffect();
|
||||
|
@ -38,9 +39,11 @@ public:
|
|||
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void windowDamaged(EffectWindow* w, const QRect& damage);
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowDeleted(EffectWindow* w);
|
||||
virtual void propertyNotify(EffectWindow* w, long atom);
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow *w);
|
||||
private:
|
||||
struct Data {
|
||||
Window window; // thumbnail of this window
|
||||
|
|
|
@ -165,6 +165,7 @@ KWIN_EFFECT_SUPPORTED(wobblywindows, WobblyWindowsEffect::supported())
|
|||
WobblyWindowsEffect::WobblyWindowsEffect()
|
||||
{
|
||||
reconfigure(ReconfigureAll);
|
||||
connect(effects, SIGNAL(windowAdded(EffectWindow*)), this, SLOT(slotWindowAdded(EffectWindow*)));
|
||||
}
|
||||
|
||||
WobblyWindowsEffect::~WobblyWindowsEffect()
|
||||
|
@ -460,7 +461,7 @@ void WobblyWindowsEffect::stepMovedResized(EffectWindow* w)
|
|||
}
|
||||
}
|
||||
|
||||
void WobblyWindowsEffect::windowAdded(EffectWindow* w)
|
||||
void WobblyWindowsEffect::slotWindowAdded(EffectWindow* w)
|
||||
{
|
||||
if (m_openEffectEnabled && w->data(WindowAddedGrabRole).value<void*>() != this) {
|
||||
if (windows.contains(w)) {
|
||||
|
|
|
@ -24,6 +24,7 @@ struct ParameterSet;
|
|||
**/
|
||||
class WobblyWindowsEffect : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
WobblyWindowsEffect();
|
||||
|
@ -35,7 +36,6 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
virtual void windowUserMovedResized(EffectWindow* c, bool first, bool last);
|
||||
virtual void windowAdded(EffectWindow* w);
|
||||
virtual void windowClosed(EffectWindow* w);
|
||||
|
||||
// Wobbly model parameters
|
||||
|
@ -58,6 +58,9 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(EffectWindow *w);
|
||||
|
||||
private:
|
||||
|
||||
void startMovedResized(EffectWindow* w);
|
||||
|
|
|
@ -131,10 +131,6 @@ void Effect::windowOpacityChanged(EffectWindow*, double)
|
|||
{
|
||||
}
|
||||
|
||||
void Effect::windowAdded(EffectWindow*)
|
||||
{
|
||||
}
|
||||
|
||||
void Effect::windowClosed(EffectWindow*)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -445,7 +445,6 @@ public:
|
|||
/** called when the geometry changed during moving/resizing. */
|
||||
virtual void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& geometry);
|
||||
virtual void windowOpacityChanged(EffectWindow* c, double old_opacity);
|
||||
virtual void windowAdded(EffectWindow* c);
|
||||
virtual void windowClosed(EffectWindow* c);
|
||||
virtual void windowDeleted(EffectWindow* c);
|
||||
virtual void windowActivated(EffectWindow* c);
|
||||
|
@ -839,6 +838,12 @@ Q_SIGNALS:
|
|||
* @since 4.7
|
||||
**/
|
||||
void desktopChanged(int oldDesktop, int newDesktop);
|
||||
/**
|
||||
* Signal emitted when a new window has been added to the Workspace.
|
||||
* @param w The added window
|
||||
* @since 4.7
|
||||
**/
|
||||
void windowAdded(EffectWindow *w);
|
||||
|
||||
protected:
|
||||
QVector< EffectPair > loaded_effects;
|
||||
|
|
|
@ -564,8 +564,6 @@ Client* Workspace::createClient(Window w, bool is_mapped)
|
|||
|
||||
if (scene)
|
||||
scene->windowAdded(c);
|
||||
if (effects)
|
||||
static_cast<EffectsHandlerImpl*>(effects)->windowAdded(c->effectWindow());
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -581,8 +579,7 @@ Unmanaged* Workspace::createUnmanaged(Window w)
|
|||
addUnmanaged(c, Allowed);
|
||||
if (scene)
|
||||
scene->windowAdded(c);
|
||||
if (effects)
|
||||
static_cast<EffectsHandlerImpl*>(effects)->windowAdded(c->effectWindow());
|
||||
emit unmanagedAdded(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
@ -910,6 +910,7 @@ signals:
|
|||
void clientRemoved(KWin::Client*);
|
||||
void clientActivated(KWin::Client*);
|
||||
void groupAdded(KWin::Group*);
|
||||
void unmanagedAdded(KWin::Unmanaged*);
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
|
Loading…
Reference in a new issue