We’re excited to announce that a preview of native Wayland support for JUCE is now available on a new public wayland branch of the JUCE repository.
If you develop standalone applications, audio software, or embedded Linux products, please give this branch a try!
Native Wayland by Default
When a standalone JUCE application starts in a Wayland session (WAYLAND_DISPLAY is set), JUCE will attempt to create native Wayland peers. If Wayland is unavailable, JUCE falls back to X11. The Wayland libraries are loaded at runtime, allowing the same
application binary to run in native Wayland, X11, and XWayland environments.
The Wayland backend adds no build dependencies to juce_gui_basics. JUCE talks to the compositor through its own protocol bindings and loads libwayland-client at runtime. X11 remains a supported JUCE backend. Plugin editors will continue to use X11/XWayland.
Note that this preview compiles both Wayland and X11 backends (the X11 development headers remain build dependencies at this time).
Desktop and embedded Linux
In addition to desktop Linux, embedded Linux has been an important driver for this work.
Standalone JUCE applications can now run directly on Weston without requiring an XWayland server merely to display their interface. This is useful for musical instruments, effects processors, control surfaces, kiosks, and other dedicated products built around Yocto or similarly focused Linux images. Touch input arrives directly from the compositor, so touch panels work on systems with no X server at all.
Wayland’s OpenGLContext support includes OpenGL ES and has been tested by the JUCE team on embedded hardware.
What Wayland adds over X11
The Wayland backend includes first-class desktop features such as:
- Chinese, Japanese, and Korean (CJK) support for Input Method Editors (IMEs)
- Smooth touchpad scrolling
- High-resolution mouse wheels with natural scrolling
- Compositor-driven repainting
- Ability to run on systems without X11
- Fractional scaling (for example 125% or 150%, per-monitor) and HiDPI support.
- Hot-plug display support
- File chooser integration through XDG Desktop Portal
- Some default embedded hardware operating systems require Wayland to access OpenGL or other, similar, hardware accelerated graphics contexts
Known Limitations
Wayland is currently limited to standalone applications. Plugin editors continue to use X11/XWayland.
Other things to note:
WebBrowserComponentis heavily dependent upon specific X11 machinery and is therefore not available on Wayland.toFront(),toBehind(), and always-on-top have no Wayland equivalent.- Wayland is very strict about popup/menu ordering and window placement. Wayland has no global window coordinates. A window cannot read or set its own screen position. The compositor ultimately decides where windows land. Please let us know if you see any issues here!
Known issues under investigation
- Popup placement from hosted audio plugins
- Drag and drop icon placement
- Generic titlebar icons displayed
Testing
The JUCE team has tested on multiple versions of GNOME (Mutter), KDE Plasma (KWin), Hyprland, and Weston as well as on embedded hardware. Feedback from different distributions, compositors, and display configurations is very much appreciated!
Please reply to this thread with any problems you encounter. Reports are most helpful when they include:
- Linux distribution and version
- Desktop environment and Wayland compositor
- Whether the application used software rendering, OpenGL, or OpenGL ES
- Whether the problem also occurs under X11/XWayland
To compare a problem against the X11 backend on the same machine, start your app with WAYLAND_DISPLAY unset:
env -u WAYLAND_DISPLAY ./MyApp
In the rare event that your app closes suddenly, it’s likely the compositor rejecting a request and closing the connection. Run your app from a terminal with WAYLAND_DEBUG=1 and with stderr redirected to a file:
WAYLAND_DEBUG=1 ./MyApp 2> wayland.log
Please send us the last 50 lines of that log.
Usage and Development
Given the diversity of Linux-based systems we anticipate that this public preview branch will uncover a number of new issues for us to fix, on top of the limitations and known issues already listed in this thread. However, for many embedded systems without particularly complex interactive UIs, this preview branch may already be stable enough to use immediately.