diff --git a/src/abstract_output.h b/src/abstract_output.h index 8ea54dc6ff..64e03c781d 100644 --- a/src/abstract_output.h +++ b/src/abstract_output.h @@ -216,6 +216,10 @@ Q_SIGNALS: * This signal is emitted when the output has been enabled or disabled. */ void enabledChanged(); + /** + * This signal is emitted when the device pixel ratio of the output has changed. + */ + void scaleChanged(); /** * Notifies that the display will be dimmed in @p time ms. This allows diff --git a/src/abstract_wayland_output.h b/src/abstract_wayland_output.h index 4a98a08f4a..ea6f6d801c 100644 --- a/src/abstract_wayland_output.h +++ b/src/abstract_wayland_output.h @@ -156,7 +156,6 @@ public: Q_SIGNALS: void modeChanged(); void outputChange(const QRegion &damagedRegion); - void scaleChanged(); void transformChanged(); void dpmsModeChanged(); void capabilitiesChanged(); diff --git a/src/effects.cpp b/src/effects.cpp index 086cf7d7eb..5460b853bb 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -1728,6 +1728,8 @@ EffectScreenImpl::EffectScreenImpl(AbstractOutput *output, QObject *parent) { connect(output, &AbstractOutput::wakeUp, this, &EffectScreen::wakeUp); connect(output, &AbstractOutput::aboutToTurnOff, this, &EffectScreen::aboutToTurnOff); + connect(output, &AbstractOutput::scaleChanged, this, &EffectScreen::devicePixelRatioChanged); + connect(output, &AbstractOutput::geometryChanged, this, &EffectScreen::geometryChanged); } AbstractOutput *EffectScreenImpl::platformOutput() const diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index 16a17f8989..9f69f0e6fe 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -1831,6 +1831,9 @@ protected: class KWINEFFECTS_EXPORT EffectScreen : public QObject { Q_OBJECT + Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) + Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged) + Q_PROPERTY(QString name READ name CONSTANT) public: explicit EffectScreen(QObject *parent = nullptr); @@ -1860,6 +1863,16 @@ Q_SIGNALS: * Notifies that the output has been turned on and the wake can be decorated. */ void wakeUp(); + + /** + * This signal is emitted when the geometry of this screen changes. + */ + void geometryChanged(); + + /** + * This signal is emitted when the device pixel ratio of this screen changes. + */ + void devicePixelRatioChanged(); }; /**