-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.2.4
-
None
-
-
b66d93c6b (dev), 2eb17abf4 (dev), 5b64b363b (6.5), 23a026cd3 (6.5)
Let's imagine we have a system with unsupported shell integration and XWayland (e.g. xdg-shell-v5 - Chrome OS before version 97). In such environment, Qt application "works" (the process doesn't exit, it feels like a hang), but can't show any window while it can fallback to xcb and work just fine. The naive way to fix this is:
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 8806773d..c4e251e9 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -163,6 +163,13 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
if (!mXkbContext)
qCWarning(lcQpaWayland, "failed to create xkb context");
#endif
+
+ forceRoundTrip();
+
+ if (!mWaitingScreens.isEmpty()) {
+ // Give wl_output.done and zxdg_output_v1.done events a chance to arrive
+ forceRoundTrip();
+ }
}
QWaylandDisplay::~QWaylandDisplay(void)
@@ -191,12 +198,6 @@ QWaylandDisplay::~QWaylandDisplay(void)
// so that factory functions in integration can be overridden.
void QWaylandDisplay::initialize()
{
- forceRoundTrip();
-
- if (!mWaitingScreens.isEmpty()) {
- // Give wl_output.done and zxdg_output_v1.done events a chance to arrive
- forceRoundTrip();
- }
}
void QWaylandDisplay::ensureScreen()
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 41e6c50f..728d4d5a 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -115,7 +115,7 @@ QWaylandIntegration::QWaylandIntegration()
#endif
{
mDisplay.reset(new QWaylandDisplay(this));
- if (!mDisplay->isInitialized()) {
+ if (!mDisplay->isInitialized() || !shellIntegration()) {
mFailed = true;
return;
}
But looks like the code in QWaylandDisplay::initialize() was separated from the constructor on a reason previously, so I haven't pushed this to gerrit.