diff --git a/src/core/output.cpp b/src/core/output.cpp index e5c1d5edb4..6151d66156 100644 --- a/src/core/output.cpp +++ b/src/core/output.cpp @@ -181,7 +181,7 @@ QRectF Output::fractionalGeometry() const QSize Output::physicalSize() const { - return orientateSize(m_information.physicalSize); + return m_information.physicalSize; } int Output::refreshRate() const diff --git a/src/core/output.h b/src/core/output.h index 7cc5e5470f..e2a59f62a0 100644 --- a/src/core/output.h +++ b/src/core/output.h @@ -172,7 +172,7 @@ public: qreal scale() const; /** - * Returns the physical size of this output, in millimeters. + * Returns the non-rotated physical size of this output, in millimeters. * * Default implementation returns an invalid QSize. */ @@ -230,6 +230,7 @@ public: }; Q_ENUM(Transform) Transform transform() const; + QSize orientateSize(const QSize &size) const; void applyChanges(const OutputConfiguration &config); @@ -355,8 +356,6 @@ protected: void setInformation(const Information &information); void setState(const State &state); - QSize orientateSize(const QSize &size) const; - EffectScreenImpl *m_effectScreen = nullptr; State m_state; Information m_information; diff --git a/src/input.cpp b/src/input.cpp index 7ae82a9734..f8e8b5fd20 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1019,7 +1019,7 @@ public: } m_lastTouchDownTime = time; auto output = workspace()->outputAt(pos); - auto physicalSize = output->physicalSize(); + auto physicalSize = output->orientateSize(output->physicalSize()); if (!physicalSize.isValid()) { physicalSize = QSize(190, 100); } @@ -1053,8 +1053,9 @@ public: return true; } auto output = workspace()->outputAt(pos); - const float xfactor = output->physicalSize().width() / (float)output->geometry().width(); - const float yfactor = output->physicalSize().height() / (float)output->geometry().height(); + const auto physicalSize = output->orientateSize(output->physicalSize()); + const float xfactor = physicalSize.width() / (float)output->geometry().width(); + const float yfactor = physicalSize.height() / (float)output->geometry().height(); auto &point = m_touchPoints[id]; const QPointF dist = pos - point;