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
wilder-5.14
David Edmundson 9 years ago
parent 86e5422bee
commit bbf7aaf344
  1. 20
      shell/main.cpp

@ -41,14 +41,18 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// Devive pixel ratio has some problems in plasmashell currently. //Plasma scales itself to font DPI
// - dialog continually expands (347951) //on X, where we don't have compositor scaling, this generally works fine.
// - Text element text is screwed (QTBUG-42606) //also there are bugs on older Qt, especially when it comes to fractional scaling
// - Panel struts (350614) //there's advantages to disabling, and (other than small context menu icons) few advantages in enabling
// This variable should possibly be removed when all are fixed
//On wayland, it's different. Everything is simpler as all co-ordinates are in the same co-ordinate system
qunsetenv("QT_DEVICE_PIXEL_RATIO"); //we don't have fractional scaling on the client so don't hit most the remaining bugs and
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); //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); QQuickWindow::setDefaultAlphaBuffer(true);

Loading…
Cancel
Save