Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.15.0, 6.0.0
-
None
-
-
91625c591c9854c7b6934c12a83df6cbcfcbfbd4
Description
If you run an Qt GUI application under a Wayland compositor (not via XWayland), and kill the compositor, the Qt application will produce the error message: "The Wayland connection broke. Did the Wayland compositor die?", and crash. For comparison, if you run such an application under X11, and kill the X server, it will print "The X11 connection broke (error 1). Did the X11 server die?", and exit.
To reproduce this behavior:
- run `weston`
- Inside Weston, open a terminal, and run `XDG_SESSION_TYPE=wayland a-qt-application & disown` ;
- kill the Weston process
- Observe that k
I think the the X11 behavior is more correct, because the connection breaking is generally the fault of the compositor, not the application; aborting 1) generally does not call any shutdown routines a program may have 2) often produces a useless core dump. (By now, I've accumulated a few hundred such core dumps. )-: On the other hand, if the Wayland connection has a fatal (non-disconnection) error, it is still appropriate to abort, as these errors generally signify a misuse of a protocol.
The source code for the X11 and Wayland disconnection routines is at: https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/xcb/qxcbconnection.cpp#L985-L988 and https://github.com/qt/qtwayland/blob/dev/src/client/qwaylanddisplay.cpp#L209-L212 .
Attachments
For Gerrit Dashboard: QTBUG-85631 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
308984,4 | Client: Gracefully exit when the compositor closes | dev | qt/qtwayland | Status: DEFERRED | 0 | 0 |