Don't assume we always have a shell

The mininimal-cpp compositor example does not have any shell extensions.

Change-Id: Ifec2822ef4f5944eed02c19ddfc47419051364a4
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
Paul Olav Tvete 2016-09-04 08:42:04 +02:00 committed by Paul Olav Tvete
parent 673cdbe1e0
commit 6cb80c8a53
2 changed files with 3 additions and 4 deletions

View File

@ -84,7 +84,8 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle)
QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window) QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
{ {
Q_ASSERT(mWaylandIntegration->shellIntegration()); if (!mWaylandIntegration->shellIntegration())
return 0;
return mWaylandIntegration->shellIntegration()->createShellSurface(window); return mWaylandIntegration->shellIntegration()->createShellSurface(window);
} }

View File

@ -399,9 +399,7 @@ void QWaylandIntegration::initializeShellIntegration()
} }
} }
Q_ASSERT(mShellIntegration); if (!mShellIntegration || !mShellIntegration->initialize(mDisplay)) {
if (!mShellIntegration->initialize(mDisplay)) {
delete mShellIntegration; delete mShellIntegration;
mShellIntegration = Q_NULLPTR; mShellIntegration = Q_NULLPTR;
qWarning("Failed to load shell integration %s", qPrintable(targetKey)); qWarning("Failed to load shell integration %s", qPrintable(targetKey));