From e93042522817003f35402adea83b8a537dba7c87 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 8 Aug 2016 12:06:40 +0200 Subject: eglfs: Fix QT_QPA_EGLFS_ROTATION with the KMS/DRM screeen It overrides geometry(). Change-Id: I93c607567d7cb688221d200dcd47c1a6ba23b26b Reviewed-by: Andy Nichols --- .../eglfs_kms_support/qeglfskmsscreen.cpp | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp') diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp index addcb366eb..fb8233a875 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp @@ -101,9 +101,29 @@ QEglFSKmsScreen::~QEglFSKmsScreen() QRect QEglFSKmsScreen::geometry() const { const int mode = m_output.mode; - return QRect(m_pos.x(), m_pos.y(), - m_output.modes[mode].hdisplay, - m_output.modes[mode].vdisplay); + QRect r(m_pos.x(), m_pos.y(), + m_output.modes[mode].hdisplay, + m_output.modes[mode].vdisplay); + + static int rotation = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION"); + switch (rotation) { + case 0: + case 180: + case -180: + break; + case 90: + case -90: { + int h = r.height(); + r.setHeight(r.width()); + r.setWidth(h); + break; + } + default: + qWarning("Invalid rotation %d specified in QT_QPA_EGLFS_ROTATION", rotation); + break; + } + + return r; } int QEglFSKmsScreen::depth() const -- cgit v1.2.3