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.h b/plugins/scenes/opengl/scene_opengl.h --- a/plugins/scenes/opengl/scene_opengl.h +++ b/plugins/scenes/opengl/scene_opengl.h @@ -123,7 +123,7 @@ QMatrix4x4 screenProjectionMatrix() const override { return m_screenProjectionMatrix; } protected: - virtual void paintSimpleScreen(int mask, QRegion region); + virtual void paintSimpleScreen(int mask, QRegion region, const ScreenPaintData &data); virtual void paintGenericScreen(int mask, ScreenPaintData data); virtual void doPaintBackground(const QVector< float >& vertices); virtual Scene::Window *createWindow(Toplevel *t); 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 @@ -742,8 +742,8 @@ { QMatrix4x4 matrix; - if (!(mask & PAINT_SCREEN_TRANSFORMED)) - return matrix; +// if (!(mask & PAINT_SCREEN_TRANSFORMED)) +// return matrix; matrix.translate(data.translation()); data.scale().applyTo(&matrix); @@ -997,17 +997,16 @@ m_projectionMatrix = createProjectionMatrix(); } -void SceneOpenGL2::paintSimpleScreen(int mask, QRegion region) +void SceneOpenGL2::paintSimpleScreen(int mask, QRegion region, const ScreenPaintData& data) { m_screenProjectionMatrix = m_projectionMatrix; - Scene::paintSimpleScreen(mask, region); + Scene::paintSimpleScreen(mask, region, data); } void SceneOpenGL2::paintGenericScreen(int mask, ScreenPaintData data) { - const QMatrix4x4 screenMatrix = transformation(mask, data); - + QMatrix4x4 screenMatrix = transformation(mask, data); m_screenProjectionMatrix = m_projectionMatrix * screenMatrix; Scene::paintGenericScreen(mask, data); diff --git a/scene.h b/scene.h --- a/scene.h +++ b/scene.h @@ -223,7 +223,7 @@ // (unoptimized) way virtual void paintGenericScreen(int mask, ScreenPaintData data); // shared implementation of painting the screen in an optimized way - virtual void paintSimpleScreen(int mask, QRegion region); + virtual void paintSimpleScreen(int mask, QRegion region, const ScreenPaintData& data); // paint the background (not the desktop background - the whole background) virtual void paintBackground(QRegion region) = 0; // called after all effects had their paintWindow() called diff --git a/scene.cpp b/scene.cpp --- a/scene.cpp +++ b/scene.cpp @@ -196,7 +196,7 @@ if (mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) paintGenericScreen(mask, data); else - paintSimpleScreen(mask, region); + paintSimpleScreen(mask, region, data); } // The generic painting code that can handle even transformations. @@ -246,7 +246,7 @@ // The optimized case without any transformations at all. // It can paint only the requested region and can use clipping // to reduce painting and improve performance. -void Scene::paintSimpleScreen(int orig_mask, QRegion region) +void Scene::paintSimpleScreen(int orig_mask, QRegion region, const ScreenPaintData &/*data*/) { assert((orig_mask & (PAINT_SCREEN_TRANSFORMED | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) == 0);