I've recently installed Ubuntu 22.04 LTS on my development laptop. Previously I was running 18.04 so this is my first experience of Wayland. I did a clean installation on a new disc. I had relatively few problems reinstalling gitkraken and cloning the repository of my source code from github but when I came to install the Qt libraries this is where my problems started. The on-line installer from the Qt website simply wouldn't run. It just exited silently. I eventually found an old version of the on-line installer executable in a backup of my downloads folder from Ubuntu 18.04 and was able to use this to download and install the same version of the Qt libraries that I was using previously (5.15.0). This is also the same version that I use on my other development machine which runs Windows 10. Keeping the two in step is useful and upgrading too many things at the same time seemed like asking for trouble. I installed the latest versions of Qt Creator (7.0.1) and g++ (11.2.0).
I was then able to build my application and, after a brief search of stack overflow I added "-platform wayland" to the command line arguments setting in Qt Creator but the application crashed almost immediately on start-up with the error "The Wayland connection experienced a fatal error: Protocol error".
Several things made me think this might be a bug in the Qt libraries rather than my application (none of them definitive!):
- At the point of application exit, apart from main() there is none of my application code in the call-stack (see below)
- My application has been stable for a long time and has survived several operating system, compiler and Qt version changes across two OS families
- The fact that the latest Qt on-line installer (itself almost certainly a Qt application) wouldn't run
I downloaded Qt 5.15.12 (the latest Qt 5 version available) and rebuilt my application against that but the result was the same.
The next step is obviously to strip my application right down to something minimal that still shows the problem but before I do I was wondering whether this is something other people have come across when migrating a Qt5 application to Wayland and whether I need to take the bigger step of upgrading to Qt6? The Qt Wiki describes Qt 5.11 as being "stable" with Wayland.
The call stack at the time of the error looks like this:
- qt_message_fatal
- QMessageLogger::fatal
- QtWaylandClient::QWaylandDisplay::checkError
- QtWaylandClient::QWaylandDisplay::flushRequests
- doActive
- QMetaObject::activate
- QSocketNotifier::activated
- QSocketNotifier::event
- QApplicationPrivate::notify_helper
- QApplication::notify
- QCoreApplication::notifyInternal2
- QCoreApplication::sendEvent
- socketNotifierSourceDispatch
- g_main_context_dispatch
- ??
- g_main_context_iteration
- QEventDispatcherGlib::processEvents
- QEventLoop::exec
- QCoreApplication::exec
- main
Many thanks.