diff --git a/src/abstract_output.h b/src/abstract_output.h index 64e03c781d..a93af2a360 100644 --- a/src/abstract_output.h +++ b/src/abstract_output.h @@ -232,6 +232,25 @@ Q_SIGNALS: */ void wakeUp(); + /** + * Notifies that the output is about to change configuration based on a + * user interaction. + * + * Be it because it gets a transformation or moved around. + * + * Only to be used for effects + */ + void aboutToChange(); + + /** + * Notifies that the output changed based on a user interaction. + * + * Be it because it gets a transformation or moved around. + * + * Only to be used for effects + */ + void changed(); + private: Q_DISABLE_COPY(AbstractOutput) int m_directScanoutCount = 0; diff --git a/src/abstract_wayland_output.cpp b/src/abstract_wayland_output.cpp index 8961614990..5ba940ded7 100644 --- a/src/abstract_wayland_output.cpp +++ b/src/abstract_wayland_output.cpp @@ -147,6 +147,8 @@ void AbstractWaylandOutput::setSubPixelInternal(SubPixel subPixel) void AbstractWaylandOutput::applyChanges(const KWaylandServer::OutputChangeSet *changeSet) { + Q_EMIT aboutToChange(); + qCDebug(KWIN_CORE) << "Apply changes to the Wayland output."; bool emitModeChanged = false; bool overallSizeCheckNeeded = false; @@ -183,6 +185,7 @@ void AbstractWaylandOutput::applyChanges(const KWaylandServer::OutputChangeSet * qCDebug(KWIN_CORE) << "Setting VRR Policy:" << changeSet->vrrPolicy(); setVrrPolicy(static_cast(changeSet->vrrPolicy())); } + Q_EMIT changed(); overallSizeCheckNeeded |= emitModeChanged; if (overallSizeCheckNeeded) { diff --git a/src/effects.cpp b/src/effects.cpp index 5460b853bb..e80bc18e5b 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1726,6 +1726,8 @@ EffectScreenImpl::EffectScreenImpl(AbstractOutput *output, QObject *parent) : EffectScreen(parent) , m_platformOutput(output) { + connect(output, &AbstractOutput::aboutToChange, this, &EffectScreen::aboutToChange); + connect(output, &AbstractOutput::changed, this, &EffectScreen::changed); connect(output, &AbstractOutput::wakeUp, this, &EffectScreen::wakeUp); connect(output, &AbstractOutput::aboutToTurnOff, this, &EffectScreen::aboutToTurnOff); connect(output, &AbstractOutput::scaleChanged, this, &EffectScreen::devicePixelRatioChanged); diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index 9f69f0e6fe..53e3d2f5a5 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -1873,6 +1873,21 @@ Q_SIGNALS: * This signal is emitted when the device pixel ratio of this screen changes. */ void devicePixelRatioChanged(); + + /** + * Notifies that the output is about to change configuration based on a + * user interaction. + * + * Be it because it gets a transformation or moved around. + */ + void aboutToChange(); + + /** + * Notifies that the output changed based on a user interaction. + * + * Be it because it gets a transformation or moved around. + */ + void changed(); }; /**