diff options
author | Giulio Camuffo <giulio.camuffo@kdab.com> | 2017-05-12 18:08:20 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-08-13 08:22:13 +0000 |
commit | 9411f6fbd9c05eaf7109982a055348a088721080 (patch) | |
tree | f18bfd61b35548b40d3ca7c8282df842668ba985 /src/client | |
parent | b1bff5a1b23a41cb7d6b3efe4469331ff14decc0 (diff) |
Client: Return a fixed value for the logical screen DPI
[ChangeLog][QPA plugin] Font and UI scaling is now based on the screen scale
factor rather than the physical DPI. The logical DPI is set to 96 unless
overridden by the the environment variable QT_WAYLAND_FORCE_DPI, which may be
set to a specific DPI or to "physical" to get the old behavior.
Change-Id: Ife417bf5537b0f6c9ecceffea46937951770b150
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandscreen.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index 892ef974b..38d61f88c 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -123,11 +123,15 @@ QSizeF QWaylandScreen::physicalSize() const QDpi QWaylandScreen::logicalDpi() const { - static int force_dpi = !qgetenv("QT_WAYLAND_FORCE_DPI").isEmpty() ? qgetenv("QT_WAYLAND_FORCE_DPI").toInt() : -1; - if (force_dpi > 0) - return QDpi(force_dpi, force_dpi); + static bool physicalDpi = qEnvironmentVariable("QT_WAYLAND_FORCE_DPI") == QStringLiteral("physical"); + if (physicalDpi) + return QPlatformScreen::logicalDpi(); - return QPlatformScreen::logicalDpi(); + static int forceDpi = qgetenv("QT_WAYLAND_FORCE_DPI").toInt(); + if (forceDpi) + return QDpi(forceDpi, forceDpi); + + return QDpi(96, 96); } QList<QPlatformScreen *> QWaylandScreen::virtualSiblings() const |