From bbf7aaf3448532b38819456fbe88ed866fb6fec0 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 7 Aug 2017 19:52:47 +0100 Subject: [PATCH] Use Qt scaling in Plamsa Summary: I've done this only when on Wayland because: On X, our own scaling to font generally works well. There are bugs on older Qt, especially when it comes to fractional scaling, and we can't support per screen scales anyway. There's advantages to disabling, and (other than small context menu icons) few advantages in enabling On wayland, it's different. Everything is simpler as all co-ordinates are in the same co-ordinate system we don't have fractional scaling on the client so don't hit most the remaining bugs and even if we don't use Qt scaling the compositor will try to scale us anyway so we have no choice CCBUG: 356446 Test Plan: Had this for about a week on my laptop. Haven't noticed a single problem. Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: mart, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D7188 --- shell/main.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/shell/main.cpp b/shell/main.cpp index 7478b73c3..3ba3ad4be 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -41,14 +41,18 @@ int main(int argc, char *argv[]) { -// Devive pixel ratio has some problems in plasmashell currently. -// - dialog continually expands (347951) -// - Text element text is screwed (QTBUG-42606) -// - Panel struts (350614) -// This variable should possibly be removed when all are fixed - - qunsetenv("QT_DEVICE_PIXEL_RATIO"); - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + //Plasma scales itself to font DPI + //on X, where we don't have compositor scaling, this generally works fine. + //also there are bugs on older Qt, especially when it comes to fractional scaling + //there's advantages to disabling, and (other than small context menu icons) few advantages in enabling + + //On wayland, it's different. Everything is simpler as all co-ordinates are in the same co-ordinate system + //we don't have fractional scaling on the client so don't hit most the remaining bugs and + //even if we don't use Qt scaling the compositor will try to scale us anyway so we have no choice + if (KWindowSystem::isPlatformX11()) { + qunsetenv("QT_DEVICE_PIXEL_RATIO"); + QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + } QQuickWindow::setDefaultAlphaBuffer(true);