Don't crash when trying to run on a compositor without outputs

Change-Id: I164ad71f42dff1ad92576729040608016497a56a
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
This commit is contained in:
Johan Klokkhammer Helsing 2016-11-24 13:50:19 +01:00 committed by Johan Helsing
parent 1835e6ed5c
commit 7a116ac3f0

View File

@ -216,6 +216,11 @@ void QWaylandIntegration::initialize()
int fd = wl_display_get_fd(mDisplay->wl_display());
QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data());
QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests()));
if (mDisplay->screens().isEmpty()) {
qWarning() << "Running on a compositor with no screens is not supported";
::exit(EXIT_FAILURE);
}
}
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const