summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandintegration.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-14 16:22:25 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-02-26 15:59:45 +0000
commit72999738489b5251d025c954a77c93e8e1fdfd9d (patch)
tree1e17836dea84c49e078aacbc3a363ca305dbe605 /src/client/qwaylandintegration.cpp
parent5b69d5f05fdf187ae8a5f08e9a57375cbbd7f142 (diff)
Client: Fail gracefully when wl_display_connect fails
[ChangeLog][QPA plugin] If we're unable to create a connection to the Wayland display, fail gracefully so other platform integrations can be tried instead. This also adds QWaylandIntegration::hasFailed() which can later be extended to report that the platform plugin is unusable for other reasons. I.e. no compatible shell extensions or similar. Task-number: QTBUG-59762 Change-Id: I0f1ae73982e2860814235c1a189741d130e1db3e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r--src/client/qwaylandintegration.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 698abd8fd..267e481ac 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -134,6 +134,10 @@ QWaylandIntegration::QWaylandIntegration()
{
initializeInputDeviceIntegration();
mDisplay.reset(new QWaylandDisplay(this));
+ if (!mDisplay->isInitialized()) {
+ mFailed = true;
+ return;
+ }
#if QT_CONFIG(clipboard)
mClipboard.reset(new QWaylandClipboard(mDisplay.data()));
#endif