This release lands native Wayland support, a lot of performance improvements in the rendering stack, and a new control. Here are the highlights.
Linux: Wayland and drag-and-drop
The headline for Linux is the new native Wayland backend (PR #21448) has graduated from private preview. Rather than relying on Xwayland, Avalonia can now talk the Wayland protocol directly. This is the result of months of work: contrary to most other platforms, Wayland has its own way to do handle things, and that required core changes in Avalonia's windowing and graphics infrastructure, part of which were already in place in Avalonia 12.0. Plus, Wayland requires clients to implement a full protocol rather than calling a set of existing APIs from a library.
Currently, Wayland renders through EGL (with an optional dmabuf path). It supports all core functionalities you would expect: mouse, touch, keyboard, clipboard, drag-and-drop... However, a few KDE-specific niceties (global app menu, window icons, blur-behind) are planned as follow-ups.
This new backend is considered experimental, so it isn't picked up by UsePlatformDetect() yet. Enable it explicitly by referencing the Avalonia.Wayland package then calling UseWayland() on your app builder.
Alongside it, X11 finally gets cross-process drag-and-drop with a full implementation of XDND (PR #20926). Windows can now act as both drag sources and drop targets, allowing data to be dragged in and out of other applications. This closes one of Avalonia's longest-standing Linux issues.
Rendering improvements
A large share of this release went into enhancements in the graphics pipeline:
On X11, Avalonia now detects the maximum refresh rate of the monitors and adjusts its rendering frequency to match it (#18558), which means applications aren't capped at 60 FPS anymore. The same principle now also applies to Windows when rendering modes other than WinUIComposition (which stays the default) are used (#21643).
Some defaults have also been tuned: multiple dirty-rect clipping is now off by default (#21553), avoiding taking a hit on systems with a discrete GPU, where computing the clip is usually slower than simply rendering some extra pixels. In addition, stencil buffers are now enabled by default (#21586), allowing more clipping operations to be hardware-accelerated; they were previously disabled due to various dependency issues that have since been fixed.
Creating bitmaps directly from pixels is now several times faster (#21675).
On X11, OpenGL desktop profiles are now supported when using EGL rendering (#21393), and various fixes have been made towards NVIDIA drivers in this mode (#21590). This support extends to the new aforementioned Wayland backend.
While most rendering enhancements are made by Avalonia's core team, we sometimes get awesome external contributions in this area:
- With #21310, @hez2010 reworked how hit-testing works when a container contains many visuals, reducing the time spent in this area by several hundredfold in extreme cases.
- In #21366, @ZehMatt rewrote how rendering data is serialized internally to Avalonia's compositor, greatly reducing memory allocations and, consequently, garbage collector pauses, leading to smoother frame times.
- On Windows, #20757 by @lindexi changes how GPU surfaces are created when transparency isn't needed, leading to reduced GPU usage for integrated graphics cards.
That's the power of open source!
New control: TableView
TableView (#21511) is a new control for displaying tabular, read-only data, akin to WPF's GridView. It fills the gap between a plain ListBox and the heavier DataGrid (which is in maintenance mode) or TreeDataGrid (part of Avalonia Pro) when you just need columns over a collection without editing.
Columns are defined in XAML and support cell content via a binding or a full cell template, absolute and star-sized column widths, horizontal alignment, and can optionally be resized by users. Like the ListBox it's based on, it also recycles rows and cells to improve scrolling performance.
Platform improvements
On mobile, sound and haptic feedback have been implemented (#21189). Users of Android and iOS applications now experience feedback similar to what they're used to in native applications. This is fully configurable using the new PlatformFeedback API.
The new Avalonia.WinUI package (#21430) allows embedding Avalonia controls in a WinUI 3 application. This is part of our continued effort to bring Avalonia and MAUI together.
You'll also find small new platform-specific features coming with this release, like the ability to specify whether window corners are rounded on Windows 11+ (#21615), or the detection of system theme change on Android (#16340).
EU Cyber Resilience Act
Finally, a note on supply-chain transparency. Avalonia 12.1.0 is the first release to ship with a Software Bill of Materials (SBOM), listing every NuGet package that goes into the framework. This is the opening move in a longer piece of work as we prepare for the EU Cyber Resilience Act, which introduces new obligations around vulnerability handling and transparency across the software supply chain ahead of its phased enforcement. Publishing an SBOM with each release gives you a verifiable inventory of what's inside Avalonia, makes it far easier to audit your own dependencies, and lays the groundwork for the compliance tooling we'll be rolling out over the coming releases.
Changelog
As with every release, Avalonia 12.1 also comes with several bug fixes and other minor enhancements. Read the complete changelog for details.
Thanks to everyone who contributed to this release!