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
This commit is contained in:
parent
1e2a0028c3
commit
3cc39ba35e
1 changed files with 16 additions and 0 deletions
|
@ -97,7 +97,11 @@ void Integration::initialize()
|
||||||
);
|
);
|
||||||
QPlatformIntegration::initialize();
|
QPlatformIntegration::initialize();
|
||||||
auto dummyScreen = new Screen(-1);
|
auto dummyScreen = new Screen(-1);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||||
|
QWindowSystemInterface::handleScreenAdded(dummyScreen);
|
||||||
|
#else
|
||||||
screenAdded(dummyScreen);
|
screenAdded(dummyScreen);
|
||||||
|
#endif
|
||||||
m_screens << dummyScreen;
|
m_screens << dummyScreen;
|
||||||
m_inputContext.reset(QPlatformInputContextFactory::create(QStringLiteral("qtvirtualkeyboard")));
|
m_inputContext.reset(QPlatformInputContextFactory::create(QStringLiteral("qtvirtualkeyboard")));
|
||||||
qunsetenv("QT_IM_MODULE");
|
qunsetenv("QT_IM_MODULE");
|
||||||
|
@ -200,16 +204,28 @@ void Integration::initScreens()
|
||||||
newScreens.reserve(qMax(screens()->count(), 1));
|
newScreens.reserve(qMax(screens()->count(), 1));
|
||||||
for (int i = 0; i < screens()->count(); i++) {
|
for (int i = 0; i < screens()->count(); i++) {
|
||||||
auto screen = new Screen(i);
|
auto screen = new Screen(i);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||||
|
QWindowSystemInterface::handleScreenAdded(screen);
|
||||||
|
#else
|
||||||
screenAdded(screen);
|
screenAdded(screen);
|
||||||
|
#endif
|
||||||
newScreens << screen;
|
newScreens << screen;
|
||||||
}
|
}
|
||||||
if (newScreens.isEmpty()) {
|
if (newScreens.isEmpty()) {
|
||||||
auto dummyScreen = new Screen(-1);
|
auto dummyScreen = new Screen(-1);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||||
|
QWindowSystemInterface::handleScreenAdded(dummyScreen);
|
||||||
|
#else
|
||||||
screenAdded(dummyScreen);
|
screenAdded(dummyScreen);
|
||||||
|
#endif
|
||||||
newScreens << dummyScreen;
|
newScreens << dummyScreen;
|
||||||
}
|
}
|
||||||
while (!m_screens.isEmpty()) {
|
while (!m_screens.isEmpty()) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||||
|
QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast());
|
||||||
|
#else
|
||||||
destroyScreen(m_screens.takeLast());
|
destroyScreen(m_screens.takeLast());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
m_screens = newScreens;
|
m_screens = newScreens;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue