From 3cc39ba35eb2afa9a39925daf58354e500e4da2b Mon Sep 17 00:00:00 2001 From: Jimi Huotari Date: Wed, 3 Apr 2019 23:52:01 +0300 Subject: [PATCH] Fix plugins/qpa build with Qt 5.13 Summary: Upstream moved screen maintenance functions from QPlatformIntegration to QWSI. BUG: 406056 See also: https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.13&id=01e1df90 Test Plan: Built fine with Qt 5.12.2 and Qt 5.13 stable branch. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: zzag, arojas, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D20239 --- plugins/qpa/integration.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/qpa/integration.cpp b/plugins/qpa/integration.cpp index 4bf5fb8bef..c48b471e7f 100644 --- a/plugins/qpa/integration.cpp +++ b/plugins/qpa/integration.cpp @@ -97,7 +97,11 @@ void Integration::initialize() ); QPlatformIntegration::initialize(); auto dummyScreen = new Screen(-1); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + QWindowSystemInterface::handleScreenAdded(dummyScreen); +#else screenAdded(dummyScreen); +#endif m_screens << dummyScreen; m_inputContext.reset(QPlatformInputContextFactory::create(QStringLiteral("qtvirtualkeyboard"))); qunsetenv("QT_IM_MODULE"); @@ -200,16 +204,28 @@ void Integration::initScreens() newScreens.reserve(qMax(screens()->count(), 1)); for (int i = 0; i < screens()->count(); i++) { auto screen = new Screen(i); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + QWindowSystemInterface::handleScreenAdded(screen); +#else screenAdded(screen); +#endif newScreens << screen; } if (newScreens.isEmpty()) { auto dummyScreen = new Screen(-1); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + QWindowSystemInterface::handleScreenAdded(dummyScreen); +#else screenAdded(dummyScreen); +#endif newScreens << dummyScreen; } while (!m_screens.isEmpty()) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast()); +#else destroyScreen(m_screens.takeLast()); +#endif } m_screens = newScreens; }