SlopOS
ABI

Window And Protocol Surfaces

Windowing, surface, and display protocol ABI

SlopOS windowing has three layers:

LayerRole
Kernel ABI structsShared state and constants
Wire protocolDisplay protocol v2 request/event encoding
Client runtimeRaw windows, surfaces, event loop, widgets

Kernel Window ABI

WindowInfo is the shared window metadata structure. It includes task id, position, content size, window state, cursor shape, shared-memory token, damage regions, title, app id, and compositor-provided frame dimensions.

Important constants:

ConstantMeaning
MAX_WINDOW_DAMAGE_REGIONSPer-window damage-region cap
MAX_BUFFER_AGEBuffer-age bound
WINDOW_STATE_NORMALNormal toplevel
WINDOW_STATE_MINIMIZEDMinimized toplevel
WINDOW_STATE_MAXIMIZEDMaximized toplevel
CURSOR_SHAPE_*Cursor shape ids from default through resize shapes

SurfaceRole follows Wayland-style role assignment: None, Toplevel, Popup, and Subsurface. Roles are not intended to change once assigned.

Display Protocol V2

slop-protocol is a length-prefixed little-endian binary protocol. It includes:

Request groupExamples
HandshakeHello { version }
Surface lifecyclecreate, attach, damage, commit, frame, destroy
Toplevel lifecycleget toplevel, set title, set app id, ack configure, destroy
Cursorset cursor shape
Clipboardcopy, paste, read via memfd-backed buffers
Interactive actionsmove and resize authorized by input serials

Server events include hello/capabilities, output info, configure, input events, frame callbacks, clipboard readiness/results, and protocol errors.

Buffer Passing

Window buffers use memfd_create, ftruncate, and mmap(MAP_SHARED). Protocol messages that transfer a buffer fd use AF_UNIX ancillary data. The receiver wraps fds in OwnedFd so file descriptors are closed on drop unless explicitly consumed.

Runtime Crates

  • The windowing runtime exposes raw windows, surfaces, protocol handles, and event-loop helpers.
  • AppKit exposes retained UI nodes, layout constraints, input/focus handling, widget traits, and app launch helpers.

On this page