Skip to content

Running programs natively under Wayland

Simon Ser edited this page Jul 3, 2019 · 53 revisions

If your toolkit/library supports this, you can have your apps run natively (without Xwayland) by setting some environment variables (you can add them to your launcher script or a session file if you're using a display manager).

You can disable Xwayland (X clients under Wayland) support by specifying xwayland disable in your Sway config.

GTK3

Wayland should be selected by default. If not, this can be overridden on a per-app basis by setting:

# Do not set this globally
GDK_BACKEND=wayland
CLUTTER_BACKEND=wayland

Setting GDK_BACKEND=wayland however can still lead to startup crashes with some applications, e.g. chromium (as of Feb. 2019) and electron. For this reason GDK_BACKEND should not be set globally.

Qt5

Wayland is used by default if XDG_SESSION_TYPE=wayland is set (ie. if you use a display manager). If not:

QT_QPA_PLATFORM=wayland-egl

To use your monitor's DPI instead of the default of 96 DPI:

QT_WAYLAND_FORCE_DPI=physical

Older versions of Qt always show window decorations. To hide them:

QT_WAYLAND_DISABLE_WINDOWDECORATION=1

Elementary/EFL

ECORE_EVAS_ENGINE=wayland_egl
ELM_ENGINE=wayland_egl

You could set them to wayland_shm instead, if you want to use software rendering.

SDL

SDL_VIDEODRIVER=wayland

GLFW

Wayland needs to be selected at compile-time. Arch users can install glfw-wayland.

Java under Xwayland

Some Java AWT applications would not display properly unless you set the following.

_JAVA_AWT_WM_NONREPARENTING=1

Firefox

Wayland isn't the default yet.

MOZ_ENABLE_WAYLAND=1