summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2015-03-02 10:48:21 +0100
committerShawn Rutledge <shawn.rutledge@digia.com>2015-03-06 19:54:46 +0000
commit51ada7734ad780178ecced11e0dff454dfc2e5f2 (patch)
tree4a56f0635c100f5053fd9ddf36b0e2cb5150dcea /src/plugins
parentd7401c32c5eb514da639753d939fafabd9d3492f (diff)
xcb: do not create a dummy QScreen when there are no outputs
Whenever a QWindow is associated with a QScreen, the screen is expected to be a real working one, so that rendering continues to be possible. This partially reverts 52f5e50f11a3ba82e32dc2efc656e4021a3fa4f5 [ChangeLog][QPA][Xcb] If all QScreens (xcb outputs) are disconnected while an application is running, QGuiApplication::primaryScreen() will return null until a screen is connected again. Task-number: QTBUG-40174 Task-number: QTBUG-42985 Change-Id: Id1b29dd70eaf3f2e7fd477516ce7e2bf24e095f6 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 9247da814d..da973b5313 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -215,16 +215,6 @@ void QXcbConnection::updateScreens()
}
free(primary);
}
- // If there's no randr extension, or there was some error above, or the screen
- // doesn't have outputs for some other reason (e.g. on VNC or ssh -X), just assume there is one screen.
- if (connectedOutputCount == 0) {
- qCDebug(lcQpaScreen, "found a screen with zero outputs");
- QXcbScreen *screen = findOrCreateScreen(newScreens, xcbScreenNumber, xcbScreen);
- siblings << screen;
- activeScreens << screen;
- if (!primaryScreen)
- primaryScreen = screen;
- }
foreach (QPlatformScreen* s, siblings)
((QXcbScreen*)s)->setVirtualSiblings(siblings);
xcb_screen_next(&it);
@@ -282,6 +272,11 @@ void QXcbConnection::updateScreens()
if (!m_screens.isEmpty())
qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name();
+ else
+ // QTBUG-40174, QTBUG-42985: If there are no outputs, then there must be
+ // no QScreen instances; a Qt application can survive this situation, and
+ // start rendering again later when there is a screen again.
+ qCDebug(lcQpaScreen) << "xcb connection has no outputs";
}
QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName)