From 894ed68ff4121c9e035d68919f4a52b814e6c320 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 27 Aug 2021 10:06:11 +0300 Subject: [PATCH] effects: Wire EffectsHandler::screenGeometryChanged() to Screens::geometryChanged() Currently, the EffectsHandler has two signals that are emitted when the combined geometry of all outputs change - virtualScreenGeometryChanged() and screenGeometryChanged(). Having two signals is most likely a historical artifact. This change untangles the screenGeometryChanged() signal from the Workspace and makes it the same as the virtualScreenGeometryChanged() signal. --- src/effects.cpp | 8 +++----- src/effects.h | 1 - src/workspace.cpp | 4 ---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/effects.cpp b/src/effects.cpp index 2ef07965ae..abdc85e6e8 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -191,6 +191,9 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) connect(Screens::self(), &Screens::countChanged, this, &EffectsHandler::numberScreensChanged); connect(Screens::self(), &Screens::sizeChanged, this, &EffectsHandler::virtualScreenSizeChanged); connect(Screens::self(), &Screens::geometryChanged, this, &EffectsHandler::virtualScreenGeometryChanged); + connect(Screens::self(), &Screens::geometryChanged, this, [this]() { + Q_EMIT screenGeometryChanged(Screens::self()->size()); + }); #ifdef KWIN_BUILD_ACTIVITIES if (Activities *activities = Activities::self()) { connect(activities, &Activities::added, this, &EffectsHandler::activityAdded); @@ -781,11 +784,6 @@ bool EffectsHandlerImpl::hasKeyboardGrab() const return keyboard_grab_effect != nullptr; } -void EffectsHandlerImpl::desktopResized(const QSize &size) -{ - Q_EMIT screenGeometryChanged(size); -} - void EffectsHandlerImpl::registerPropertyType(long atom, bool reg) { if (reg) diff --git a/src/effects.h b/src/effects.h index f2aefdb4a1..683da8a74b 100644 --- a/src/effects.h +++ b/src/effects.h @@ -187,7 +187,6 @@ public: void startPaint(); void grabbedKeyboardEvent(QKeyEvent* e); bool hasKeyboardGrab() const; - void desktopResized(const QSize &size); void reloadEffect(Effect *effect) override; QStringList loadedEffects() const; diff --git a/src/workspace.cpp b/src/workspace.cpp index 18c7c5bbad..906fb5d4a7 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -2069,10 +2069,6 @@ void Workspace::desktopResized() // TODO: emit a signal instead and remove the deep function calls into edges and effects ScreenEdges::self()->recreateEdges(); - - if (effects) { - static_cast(effects)->desktopResized(geom.size()); - } } void Workspace::saveOldScreenSizes()