This wiki page describe settings for wayland.
Remarks: use xcb instead of wayland on touchscreen devices, as some qt applications do not work with wayland on touchscreen devices.
sudo apt install -y libglfw3-wayland xwayland qtwayland5 qt5ct clipman wl-clipboard weston mutter
sudo nano /etc/environment.d/100-im.config
QT_QPA_PLATFORM="wayland;xcb"
QT_QPA_PLATFORMTHEME=qt5ct
CLUTTER_BACKEND=wayland
SDL_VIDEODRIVER=x11
nano ~/.bashrc
add the following lines:
export QT_QPA_PLATFORM="wayland;xcb"
export QT_QPA_PLATFORMTHEME=qt5ct
export CLUTTER_BACKEND=wayland
export SDL_VIDEODRIVER=x11
xrdb -load .Xsession
nano ~/.config/electron-flags.conf
add the following lines (without empty lines):
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto
Known issues:
-
Changing accessiblity settings, like "Large mouse cursor", after Linux virtual machine is created can cause display issues with some gui applications. Some gui applications keep close and reopen and make them unusable.
-
Some qt applications run with the following error. It is possible that there is a bug that comes with the built-in wayland compositor as the error message indicates, e.g.:
qt.qpa.wayland: Ignoring unexpected wl_surface.enter received for output with id: 7 screen name: "Screen5" screen model: "202B" This is most likely a bug in the compositor.
-
Some Qt applications does not work on touchscreen devices with wayland. For example, https://github.com/eliranwong/UniqueBible/wiki/QT_QPA_PLATFORM#touchscreen-users
Workaround:
If a particular Qt application does not work with wayland, run it with:
env QT_QPA_PLATFORM=xcb [application]
If a particular GTK application does not work with wayland, run it with:
env GDK_BACKEND=x11 [application]
If a particular Rust application does not work with wayland, run it with:
env WINIT_UNIX_BACKEND=x11 [application]