From 51b44f4a879e4dcb53c1a685d58cfef20fa18543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 10 Nov 2015 10:58:33 +0100 Subject: [PATCH] [autotests/wayland] Fix with Qt 5.6 Test need to disable HighDPI, otherwise they crash. --- autotests/wayland/kwin_wayland_test.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autotests/wayland/kwin_wayland_test.h b/autotests/wayland/kwin_wayland_test.h index 180a223870..5d07c257e3 100644 --- a/autotests/wayland/kwin_wayland_test.h +++ b/autotests/wayland/kwin_wayland_test.h @@ -51,16 +51,23 @@ private: } -#define WAYLANTEST_MAIN(TestObject) \ +#define WAYLANDTEST_MAIN_HELPER(TestObject, DPI) \ int main(int argc, char *argv[]) \ { \ setenv("QT_QPA_PLATFORM", "wayland-org.kde.kwin.qpa", true); \ setenv("QT_QPA_PLATFORM_PLUGIN_PATH", KWINQPAPATH, true); \ setenv("KWIN_FOCRE_OWN_QPA", "1", true); \ + DPI; \ KWin::WaylandTestApplication app(argc, argv); \ app.setAttribute(Qt::AA_Use96Dpi, true); \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ } +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) +#define WAYLANTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject, QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling) ) +#else +#define WAYLANTEST_MAIN(TestObject) WAYLANDTEST_MAIN_HELPER(TestObject,) +#endif + #endif