diff --git a/abstract_output.h b/abstract_output.h --- a/abstract_output.h +++ b/abstract_output.h @@ -117,6 +117,8 @@ return false; } + QSize orientateSize(const QSize &size) const; + Q_SIGNALS: void modeChanged(); @@ -171,8 +173,6 @@ void setWaylandMode(const QSize &size, int refreshRate); - QSize orientateSize(const QSize &size) const; - private: QPointer m_waylandOutput; QPointer m_xdgOutput; diff --git a/abstract_output.cpp b/abstract_output.cpp --- a/abstract_output.cpp +++ b/abstract_output.cpp @@ -54,7 +54,7 @@ QRect AbstractOutput::geometry() const { - return QRect(m_globalPos, pixelSize() / scale()); + return QRect(m_globalPos, orientateSize(pixelSize()) / scale()); } QSize AbstractOutput::physicalSize() const @@ -101,7 +101,7 @@ m_waylandOutputDevice->setScaleF(scale); } if (m_xdgOutput) { - m_xdgOutput->setLogicalSize(pixelSize() / m_scale); + m_xdgOutput->setLogicalSize(orientateSize(pixelSize()) / m_scale); m_xdgOutput->done(); } emit modeChanged(); @@ -160,7 +160,7 @@ } m_waylandOutput->setCurrentMode(size, refreshRate); if (m_xdgOutput) { - m_xdgOutput->setLogicalSize(pixelSize() / scale()); + m_xdgOutput->setLogicalSize(orientateSize(pixelSize()) / scale()); m_xdgOutput->done(); } } diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -783,7 +783,7 @@ QSize DrmOutput::pixelSize() const { - return orientateSize(QSize(m_mode.hdisplay, m_mode.vdisplay)); + return QSize(m_mode.hdisplay, m_mode.vdisplay); } void DrmOutput::setWaylandMode() @@ -898,7 +898,7 @@ // go back to previous state if (m_lastWorkingState.valid) { m_mode = m_lastWorkingState.mode; - setOrientation(m_lastWorkingState.orientation); + //setOrientation(m_lastWorkingState.orientation); setGlobalPos(m_lastWorkingState.globalPos); if (m_primaryPlane) { m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); diff --git a/plugins/platforms/drm/egl_gbm_backend.cpp b/plugins/platforms/drm/egl_gbm_backend.cpp --- a/plugins/platforms/drm/egl_gbm_backend.cpp +++ b/plugins/platforms/drm/egl_gbm_backend.cpp @@ -232,7 +232,7 @@ return false; } // TODO: ensure the viewport is set correctly each time - const QSize &overall = screens()->size(); + const QSize &overall = output.output->orientateSize(screens()->size()); const QRect &v = output.output->geometry(); // TODO: are the values correct? diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -1006,8 +1006,10 @@ void SceneOpenGL2::paintGenericScreen(int mask, ScreenPaintData data) { - const QMatrix4x4 screenMatrix = transformation(mask, data); - + data.setRotationOrigin(QVector3D(data.outputGeometry().center())); + data.setRotationAxis(QVector3D(0, 0, 1)); + data.setRotationAngle(90); + QMatrix4x4 screenMatrix = transformation(mask, data); m_screenProjectionMatrix = m_projectionMatrix * screenMatrix; Scene::paintGenericScreen(mask, data); diff --git a/scene.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -193,10 +193,10 @@ // the function that'll be eventually called by paintScreen() above void Scene::finalPaintScreen(int mask, QRegion region, ScreenPaintData& data) { - if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) +// if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) paintGenericScreen(mask, data); - else - paintSimpleScreen(mask, region); +// else +// paintSimpleScreen(mask, region); } // The generic painting code that can handle even transformations.