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>
This commit is contained in:
parent
0848300f0b
commit
b21ecf062a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user