Package: qt6-wayland
Version: 6.8.2-4
Severity: normal
Tags: upstream

While building & testing the current stable Flightgear application with
Qt6 on my Wayland-only Sway desktop, on Debian stable (trixie), the Qt
based launcher GUI of Flightgear aborts at startup with a message that
indicates an unexpected event has occurred on the XDG Toplevel window of
the launcher.

'xdg_toplevel' has no event 3

I expect the application to run correctly and display the Flightgear
launcher GUI.

Investigating the failure, I find that event 3 (wm_capabilities) has been part of Wayland XDG shell protocol since version 5, which is the version offered by my Sway compositor.

https://wayland.app/protocols/xdg-shell#xdg_toplevel:event:wm_capabilities

Running with WAYLAND_DEBUG=1 I see the Qt6 library bind to version 5 of
the XDG shell protocol (xdg_wm_base), but it seems unable to process the
wm_capabilities event. I turn to the source for Qt6 to establish why it
is requesting a version that it cannot process and discover what I believe to be a long term bug (still present in unstable, as below):

https://sources.debian.org/src/qt6-wayland/6.9.2-3/src/plugins/shellintegration/xdg-shell/qwaylandxdgshellintegration.cpp#L17

which hard-codes the supported protocol version at '6', but the Toplevel
implementation only supports event handlers for events 0,1,2 (configure,
close, configure_bounds):

https://sources.debian.org/src/qt6-wayland/6.9.2-3/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h#L87

To prove this is the problem, I patch the plugin library for qt6-wayland
/usr/lib/x86_64-linux-gnu/qt6/plugins/wayland-shell-integration/libxdg-shell.so)
to lower the hard-coded protocol value to '4' (using Ghidra and tweak)
which lowers the negotiated and bound protocol version with Sway.

After refreshing the ld.so.cache Flightgear now runs it's launcher as expected.

-- System Information:
Debian Release: 13.1
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.48+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages qt6-wayland depends on:
ii  libc6                                                         2.41-12
ii  libegl1                                                       1.7.0-1+b2
ii  libopengl0                                                    1.7.0-1+b2
ii libqt6core6t64 [qt6-base-private-abi] 6.8.2+dfsg-9 ii libqt6dbus6 6.8.2+dfsg-9 ii libqt6gui6 6.8.2+dfsg-9 ii libqt6opengl6 6.8.2+dfsg-9
ii  libqt6svg6                                                    6.8.2-3
ii  libqt6waylandclient6 [qt6-waylandclient-private-abi]          6.8.2-4
ii  libqt6waylandcompositor6 [qt6-waylandcompositor-private-abi]  6.8.2-4
ii  libqt6wlshellintegration6                                     6.8.2-4
ii  libstdc++6                                                    14.2.0-19
ii  libwayland-client0                                            1.23.1-3
ii  libwayland-egl1                                               1.23.1-3
ii  libwayland-server0                                            1.23.1-3

qt6-wayland recommends no packages.

qt6-wayland suggests no packages.

-- no debconf information

Reply via email to