[plugins/qpa] Add support for QT_WAYLAND_FORCE_DPI env variable

Summary:
If a user specifies the QT_WAYLAND_FORCE_DPI env variable, KWin uses
it to force a logicalDPI, just like QtWayland.

Test Plan: Normally sized window decorations

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1605
master
Martin Gräßlin 8 years ago
parent c331b3f825
commit 1350653d44

@ -3,7 +3,7 @@ set(PROJECT_VERSION "5.6.90")
set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.4.0")
set(QT_MIN_VERSION "5.5.0")
set(KF5_MIN_VERSION "5.12.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )

@ -62,5 +62,15 @@ QPlatformCursor *Screen::cursor() const
return m_cursor.data();
}
QDpi Screen::logicalDpi() const
{
static int force_dpi = qEnvironmentVariableIsSet("QT_WAYLAND_FORCE_DPI") ? qEnvironmentVariableIntValue("QT_WAYLAND_FORCE_DPI") : -1;
if (force_dpi > 0) {
return QDpi(force_dpi, force_dpi);
}
return QPlatformScreen::logicalDpi();
}
}
}

@ -47,6 +47,7 @@ public:
QImage::Format format() const override;
QSizeF physicalSize() const override;
QPlatformCursor *cursor() const override;
QDpi logicalDpi() const override;
private:
KWayland::Client::Output *m_output;

Loading…
Cancel
Save