[qpa] Always keep a at least one screen
Summary: Qt does not like having no screens. Both Qt XCB and Wayland QPAs have systems pretend there's always at least 1 screen present. Kwin already uses a dummy screen on startup, this patch reinserts the dummy screen if the platform states that all real screens are removed. BUG: 399564 Test Plan: Logged in, everything still worked Did not reproduce the original bug Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16096
This commit is contained in:
parent
43bed9a2a6
commit
6724955a76
1 changed files with 6 additions and 0 deletions
|
@ -205,11 +205,17 @@ QPlatformOpenGLContext *Integration::createPlatformOpenGLContext(QOpenGLContext
|
|||
void Integration::initScreens()
|
||||
{
|
||||
QVector<Screen*> newScreens;
|
||||
newScreens.reserve(qMax(screens()->count(), 1));
|
||||
for (int i = 0; i < screens()->count(); i++) {
|
||||
auto screen = new Screen(i);
|
||||
screenAdded(screen);
|
||||
newScreens << screen;
|
||||
}
|
||||
if (newScreens.isEmpty()) {
|
||||
auto dummyScreen = new Screen(-1);
|
||||
screenAdded(dummyScreen);
|
||||
newScreens << dummyScreen;
|
||||
}
|
||||
while (!m_screens.isEmpty()) {
|
||||
destroyScreen(m_screens.takeLast());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue