OpenJDK/Java has made progress in implementing native “pure” Wayland toolkit integration that does not rely on X.Org/X11 or XWayland to render Java GUI applications.

Developer Alexey Ushakov has updated the OpenJDK Wiki this week to outline the latest progress in getting Wayland support for OpenJDK on Linux, a further refinement to the mature X11 support.

This new toolkit support continues to be implemented from scratch and is currently being developed through Java’s Wakefield repository and the “pure_wl_toolkit” branch. So far, most of the testing seems to have been done using Wayland’s Weston reference compositor and using Ubuntu 21.10.

Here are some of the main tasks of the toolkit.

  • Event handling
    • Scheduling native events on the EDT to avoid potential contention conditions when updating state from the EDT and toolkit threads. See the full proposal here
  • Graphical device support
    • On-screen / off-screen Wayland interface management
    • Rendering over the Wayland interface using the OGL pipeline
    • Implementation of a new Vulkan-based rendering pipeline (for better performance)
  • java.awt.Robot
    • Send input events
    • Reading screen data (at least the current java application window)
  • Client-side decorations for Windows
    • Swing internal framework rendering code reusable

image

Image

▲ OpenJDK developers demonstrate their use of Java’s Wayland “WLToolkit” Progress

▲ Keyboard and mouse input has been implemented

See the OpenJDK Wiki page (https://wiki.openjdk.org/display/wakefield/Pure+Wayland+toolkit+prototype) and the JDK-8281970 bug tracker (https://bugs.openjdk) for details .org/browse/JDK-8281970).