From bd1d88359f39e8fcf46e082668c44b4f579d05cf Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 9 Nov 2016 03:47:13 +0000 Subject: [PATCH] Scale xwindowed EGL output Reviewers: #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3500 --- plugins/platforms/x11/windowed/egl_x11_backend.cpp | 4 +++- plugins/platforms/x11/windowed/x11windowed_backend.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/platforms/x11/windowed/egl_x11_backend.cpp b/plugins/platforms/x11/windowed/egl_x11_backend.cpp index 8274fe70e8..d0e08525f5 100644 --- a/plugins/platforms/x11/windowed/egl_x11_backend.cpp +++ b/plugins/platforms/x11/windowed/egl_x11_backend.cpp @@ -106,7 +106,9 @@ void EglX11Backend::setupViewport(int screenId) const QSize &overall = screens()->size(); const QRect &v = screens()->geometry(screenId); // TODO: are the values correct? - glViewport(-v.x(), v.height() - overall.height() - v.y(), overall.width(), overall.height()); + + qreal scale = screens()->scale(screenId); + glViewport(-v.x(), v.height() - overall.height() - v.y(), overall.width() * scale, overall.height() * scale); } void EglX11Backend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion) diff --git a/plugins/platforms/x11/windowed/x11windowed_backend.cpp b/plugins/platforms/x11/windowed/x11windowed_backend.cpp index 9256f13a2e..302bac7f4c 100644 --- a/plugins/platforms/x11/windowed/x11windowed_backend.cpp +++ b/plugins/platforms/x11/windowed/x11windowed_backend.cpp @@ -471,7 +471,7 @@ QVector X11WindowedBackend::screenGeometries() const { QVector ret; for (auto it = m_windows.constBegin(); it != m_windows.constEnd(); ++it) { - ret << QRect((*it).internalPosition, (*it).size); + ret << QRect((*it).internalPosition, (*it).size / (*it).scale); } return ret; }