Commit c544d4f2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

slide effect: remove redundant code

parent 77091f7f
......@@ -32,16 +32,14 @@ SlideEffect::SlideEffect()
connect(effects, &EffectsHandler::windowDeleted,
this, &SlideEffect::windowDeleted);
connect(effects, &EffectsHandler::numberDesktopsChanged,
this, &SlideEffect::numberDesktopsChanged);
this, &SlideEffect::stop);
connect(effects, &EffectsHandler::numberScreensChanged,
this, &SlideEffect::numberScreensChanged);
this, &SlideEffect::stop);
}
SlideEffect::~SlideEffect()
{
if (m_active) {
stop();
}
stop();
}
bool SlideEffect::supported()
......@@ -384,6 +382,9 @@ void SlideEffect::start(int old, int current, EffectWindow *movingWindow)
void SlideEffect::stop()
{
if (!m_active) {
return;
}
const EffectWindowList windows = effects->stackingOrder();
for (EffectWindow *w : windows) {
w->setData(WindowForceBackgroundContrastRole, QVariant());
......@@ -435,20 +436,4 @@ void SlideEffect::windowDeleted(EffectWindow *w)
m_paintCtx.fullscreenWindows.removeAll(w);
}
void SlideEffect::numberDesktopsChanged(uint)
{
if (!m_active) {
return;
}
stop();
}
void SlideEffect::numberScreensChanged()
{
if (!m_active) {
return;
}
stop();
}
} // namespace KWin
......@@ -61,9 +61,6 @@ private Q_SLOTS:
void windowAdded(EffectWindow *w);
void windowDeleted(EffectWindow *w);
void numberDesktopsChanged(uint old);
void numberScreensChanged();
private:
QPoint desktopCoords(int id) const;
QRect desktopGeometry(int id) const;
......
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