WaylandDotnet 0.2.0

dotnet add package WaylandDotnet --version 0.2.0
                    
NuGet\Install-Package WaylandDotnet -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WaylandDotnet" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WaylandDotnet" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="WaylandDotnet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WaylandDotnet --version 0.2.0
                    
#r "nuget: WaylandDotnet, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WaylandDotnet@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WaylandDotnet&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=WaylandDotnet&version=0.2.0
                    
Install as a Cake Tool

WaylandDotnet

A .NET 10 C# binding for the Wayland display server protocol. Provides type-safe access to Wayland client functionality with Native AOT compilation support.

Installation

dotnet add package WaylandDotnet

Requirements

  • .NET 10.0
  • Linux with libwayland-client
  • Wayland compositor

Quick Start

using WaylandDotnet;

// Connect to Wayland display
var display = WlDisplay.Connect();

// Get registry and discover globals
var registry = display.GetRegistry();
registry.OnGlobal += (name, interfaceName, version) => 
{
    Console.WriteLine($"Global: {interfaceName} v{version}");
};

display.Roundtrip();
display.Dispose();

Built-in Protocols

Namespace Protocol Description
WaylandDotnet wayland Core protocol (surfaces, inputs, buffers)
WaylandDotnet.Stable xdg-shell Desktop window management
WaylandDotnet.Wlr wlr-layer-shell Layer surfaces (panels, overlays)
WaylandDotnet.River river-window-management Window manager protocol

Features

  • Native AOT compatible - Uses LibraryImport for ahead-of-time compilation
  • Type-safe events - C# events instead of C callbacks
  • Nullable reference types - Full null safety support
  • IDisposable pattern - Proper resource cleanup

Example: Create a Window

using WaylandDotnet;
using WaylandDotnet.Stable;

var display = WlDisplay.Connect();
var registry = display.GetRegistry();

WlCompositor? compositor = null;
XdgWmBase? xdgWmBase = null;

registry.OnGlobal += (name, interfaceName, version) =>
{
    if (interfaceName == "wl_compositor")
        compositor = registry.Bind<WlCompositor>(name, version);
    else if (interfaceName == "xdg_wm_base")
        xdgWmBase = registry.Bind<XdgWmBase>(name, version);
};

display.Roundtrip();

var surface = compositor!.CreateSurface();
var xdgSurface = xdgWmBase!.GetXdgSurface(surface);
var toplevel = xdgSurface.GetToplevel();

toplevel.SetTitle("My Window");
surface.Commit();

// Main loop
while (true)
{
    display.Dispatch();
}

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 89 3/2/2026
0.1.0 89 2/21/2026