xcb-dotnet 1.17.0

dotnet add package xcb-dotnet --version 1.17.0
                    
NuGet\Install-Package xcb-dotnet -Version 1.17.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="xcb-dotnet" Version="1.17.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xcb-dotnet" Version="1.17.0" />
                    
Directory.Packages.props
<PackageReference Include="xcb-dotnet" />
                    
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 xcb-dotnet --version 1.17.0
                    
#r "nuget: xcb-dotnet, 1.17.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 xcb-dotnet@1.17.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=xcb-dotnet&version=1.17.0
                    
Install as a Cake Addin
#tool nuget:?package=xcb-dotnet&version=1.17.0
                    
Install as a Cake Tool

xcb-dotnet

.NET bindings for libxcb, the X protocol C-language binding.

Usage

using Xcb;

using var connection = XcbConnection.Connect();
var screen = connection.PreferredScreenInfo;

var window = connection.CreateWindow(
    parent: screen.Root, x: 0, y: 0, width: 480, height: 320,
    valueMask: XcbCw.BackPixel | XcbCw.EventMask,
    values: [screen.WhitePixel, (uint)XcbEventMask.Exposure]);
connection.SetPropertyString(window, XcbAtom.WmName, "hello");
connection.MapWindow(window);
connection.Flush();

while (true)
{
    using var e = connection.WaitForEvent();
    if (e.EventType == XcbEventType.Expose) break;
}

Requests follow xcb's asynchronous cookie model. Reply-carrying requests return a cookie whose Reply() blocks; issue several requests before collecting replies to batch round-trips:

var a = connection.InternAtom("WM_PROTOCOLS");
var b = connection.InternAtom("WM_DELETE_WINDOW");
var (wmProtocols, wmDelete) = (a.Reply(), b.Reply());

Void requests are fire-and-forget by default (errors arrive in the event queue as entries with XcbEvent.IsError); the *Checked variants return a cookie whose Check() round-trips and throws XcbException on error.

Regenerating the bindings

The generated code is checked in; consumers and CI never need clang. To regenerate after bumping the external/libxcb and external/xcb-proto submodules and requires python3 and clang:

dotnet tool restore
sh eng/generate.sh

The script first runs c_client.py over the xcb-proto XML to produce the C headers, then runs ClangSharpPInvokeGenerator once per native library.

Testing

dotnet test                  # binding tests; server tests skip without DISPLAY
xvfb-run -a dotnet test      # full suite against a headless X server
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.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
1.17.0 513 7/28/2026