[Qgis-psc] Grant report: Improved Wayland compatibility
Nyall Dawson
nyall.dawson at gmail.com
Thu Nov 12 20:16:22 PST 2026
Hi PSC,
In regards to the 2026 QGIS grant for "Improved Wayland compatibility"
(https://github.com/qgis/QGIS-Enhancement-Proposals/pull/376), the
following improvements have been made to QGIS:
Broken color picking: This functionality was fixed in
https://github.com/qgis/QGIS/pull/68063. I took the opportunity to do
some much-needed cleanups to the color picking for all platforms, as
that code was quite old and had been duplicated in a number of places
over the years. All the color picking logic has been moved to a single
helper class, which was designed to match the "best practice" approach
for color picking on modern desktop environments, including Wayland.
The new approach is more stable for all platforms (the old approach
could get "stuck" in the color picking mode in certain circumstances),
is faster, and also offers a more precise color sample relative to the
mouse cursor.
Broken mouse handling in 3D views: Fixed in
https://github.com/qgis/QGIS/pull/68081. This required a new API to
allow mouse cursor locks and relative pointer motion to be handled in
platform-specific ways, as the Qt library itself does not provide
this. On supported Wayland desktops, QGIS now uses the
pointer-constraints-unstable-v1 and relative-pointer-unstable-v1
protocols to natively lock the cursor during 3D map navigation. It's a
seamless transition for Linux users!
Application icon: the icon shown for QGIS windows under wayland
desktops would show as a pixelated icon, with color artifacts. This
was fixed by https://github.com/qgis/QGIS/pull/66710, ensuring that
QGIS windows show with pixel-perfect, high resolution icons.
Clipboard handling: wayland environments place certain constraints on
how applications are permitted to access the system clipboard. For
instance, they only have access to the clipboard when their own
application windows are directly focused. This broke foundational
assumptions in QGIS' clipboard handling, resulting in broken pasting
of features on Wayland environments. Again, this code and logic was
very old and quite fragile. I took the opportunity in
https://github.com/qgis/QGIS/pull/68083 to rework this to match Qt
expected clipboard behavior. Not only does this fix the feature
pasting under Wayland, but it also will dramatically speed up
copy/paste operations within QGIS. Furthermore, the new approach
allows features to be pasted into different QGIS instances losslessly,
retaining their original CRS and field definitions.
3D map key handling: As reported in
https://github.com/qgis/QGIS/issues/67141 and
https://github.com/qgis/QGIS/issues/67140, keyboard shortcuts and
navigation in 3D maps was broken under Wayland environments. This was
fixed in https://github.com/qgis/QGIS/pull/68080
Popup menu handling: During testing, some issues were spotted
resulting in bad placement and behavior of popup menus under Wayland.
These were fixed by https://github.com/qgis/QGIS/pull/68077 and
https://github.com/qgis/QGIS/pull/68060 (the later may also cause odd
behavior for different platforms too)
Issue with adding relations: the last Wayland related issue was
https://github.com/qgis/QGIS/issues/67935, where creating features
with relations would break the window handling under Wayland. This was
fixed by https://github.com/qgis/QGIS/pull/68089
Crashes in docking / floating windows: these were described in the
original proposal, but could no longer be reproduced when running with
current Qt and KDE versions.
Broken window placement: this was described in the original proposal.
When running under recent Qt and KDE versions, the situation is much
improved (thanks to the acceptance of the Wayland session management
protocol). Ultimately, no changes were required in QGIS to support
this protocol.
Following this, since all the known issues with Wayland were resolved,
I've removed the user-facing warning suggesting that users fallback to
an X11 session. (https://github.com/qgis/QGIS/pull/68090)
I've now been running QGIS under Wayland for a number of months, and
with these improvements, it's back to a first-class experience.
Thanks for the opportunity to improve this, and for funding this work.
Nyall
More information about the QGIS-PSC
mailing list