go-wayland

module
v0.50.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: BSD-2-Clause

README

Wayland implementation in Go

Go golangci-lint Go Reference

This module contains pure Go implementation of the Wayland protocol. Currently only wayland-client functionality is supported.

Go code is generated from protocol XML files using go-wayland-scanner.

Protocols: core wayland 1.25 (client), wayland-protocols 1.49 (stable, staging, unstable) and the wlroots protocols (wlr: layer-shell, screencopy, foreign-toplevel, data-control, output-management, virtual-pointer, virtual-keyboard, ...).

Like libwayland, the client.Context queues received file descriptors and hands each one to the event that carries it, registers objects created by the compositor (new_id events), drops events racing a destroy and reuses object ids after wl_display.delete_id. Registering and sending requests are safe for concurrent use, except that requests creating objects must be serialized (the compositor rejects new ids sent out of order).

To load cursor, minimal port of wayland-cursor & xcursor in pure Go is located at wayland/cursor & wayland/cursor/xcursor respectively.

To demonstrate the functionality of this module examples/imageviewer contains a simple image viewer. It demos displaying a top-level window, resizing of window, cursor themes, pointer and keyboard. Because it's in pure Go, it can be compiled without CGO. You can try it using the following commands:

CGO_ENABLED=0 go install github.com/vcaesar/go-wayland/examples/imageviewer@latest

imageviewer file.jpg

Fork

This repository is forked from github.com/rajveermalviya/go-wayland and includes several fixes and improvements. Forked at 0ad78d1, see the diff.

Directories

Path Synopsis
Package client is Go port of wayland-client library for writing pure Go GUI software for wayland supported platforms.
Package client is Go port of wayland-client library for writing pure Go GUI software for wayland supported platforms.
cmd
Package cursor is Go port of wayland/cursor library
Package cursor is Go port of wayland/cursor library
xcursor
Package xcursor is Go port of libxcursor functions required by wayland/cursor
Package xcursor is Go port of libxcursor functions required by wayland/cursor
examples module
external
internal
stable
staging
unstable
wayland module
wlr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL