Skip to content

Where it paints

Every surface a go-widgets tree can be shown on, and what chooses between them.

SurfaceModulePainter
A native window on X11, Wayland, macOS, Windowswindowpixels
An application with a tray icon and the system appearanceapplication, traypixels
A browser tab: a plain <canvas>webcanvas, or windowpixels
A browser desktop: a window of the wasmdesk compositorwindow (wasmbox)pixels
A terminaltuicells
An Android APKandroid, windowpixels
A picture: SVG or PNGsvgpixels

The widget tree does not change between them. What changes is who owns the buffer and who delivers input — a display server, a browser, a terminal, a Java host — and each back-end turns that input into the same toolkit.Event.

Chosen by what is there

window.Open takes no back-end argument. It looks at the environment — the platform it was built for, $WAYLAND_DISPLAY, $DISPLAY, the socket an Android host exports — and picks the one that can work. A binary built for Linux opens a Wayland window under a Wayland session and an X11 window under X; the same Android binary dials its host inside an APK and opens an ordinary Linux window under Termux. See how Open chooses.

Created on by tannevaled

Modified on by tannevaled