Help us shape the future of Go! Take the 2026 Go Developer Survey

display

package
v0.57.29 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package display is a host X client of the X server running in a WasiVM. It streams the screen as the server reports changes and injects pointer and key input, so a viewer outside the guest shows and drives the desktop.

Index

Constants

View Source
const SocketPath = "/tmp/.X11-unix/X0"

SocketPath is the Unix socket of X display 0 in the guest.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an X client of one screen. It reads the screen's changed regions and injects input with the XTEST extension.

func New

func New(conn net.Conn) (*Client, error)

New starts an X client over conn, a connection to the X server's socket, and starts tracking damage on the first screen. The screen must be 24 or 32 bits deep with 32-bit little-endian pixels, as Xvfb's are.

func (*Client) Close

func (c *Client) Close()

Close closes the connection to the X server.

func (*Client) Input

func (c *Client) Input(in *s4wave_vm.WasiVmDisplayInput)

Input injects a viewer's pointer or key event.

func (*Client) Run

func (c *Client) Run(ctx context.Context, send func(*s4wave_vm.WasiVmScene) error) error

Run sends the screen to send as a scene of one opaque layer, then each region that changes as a patch of it, until the X server closes the connection or ctx ends. Each region is the bounding box of the changes since the last one.

Jump to

Keyboard shortcuts

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