AtlatestRepositorysigil-ui
1
# Portable window services3
`(sigil ui window)` exports the following host services on Wayland and AppKit.4
They operate on an owned window on its creating thread. Host operations are5
isolated from drawing so they can move into sigil-window with the host.7
| Call | Result |8
|---|---|9
| `(window-set-title! window title)` | Boolean acceptance of a synchronous UTF-8 title update, including an identical title. |10
| `(window-clipboard-read window)` | Current text, including an empty string, or `#f` for unavailable/non-text/closed. |11
| `(window-clipboard-set! window text)` | Boolean acceptance of text ownership/publication by the host protocol. |12
| `(window-fullscreen? window)` | Actual acknowledged fullscreen state. |13
| `(window-set-fullscreen! window enabled?)` | Boolean acceptance of a queued enter/exit request. |14
| `(window-fullscreen-status window)` | `idle`, `pending`, `granted`, or `refused` for the latest request. |16
Closed or unsupported windows refuse mutations and clipboard reads; fullscreen17
state is false and status is `refused`. Calls from another thread fail the same18
way. Invalid argument types raise an error. Titles permit at most 4095 UTF-819
bytes and no NUL; text clipboard transfers permit at most 4 MiB. Clipboard20
access belongs in ordinary application dispatch, outside key filters and native21
tracking callbacks. Such callbacks refuse clipboard operations before accessing22
the host clipboard. Wayland publication also requires a valid input serial.24
An accepted fullscreen request starts as `pending`. Only a host acknowledgment25
matching the latest request grants it. Intermediate replies to older requests26
do not grant or restart its deadline. Native refusal, unsupported operation,27
or five seconds without a matching acknowledgment yields `refused`. A late28
matching acknowledgment can still grant the request; an external change away29
from its granted state makes it `refused`. A new request supersedes the old one.30
An identical-state request is also acknowledged asynchronously.32
`window-dispatch` returns `(fullscreen configured? status)` for actual state33
changes and request status changes. Each event records state and status at34
enqueue time. Completion/refusal wakes dispatch, including an indefinite wait;35
there is no periodic fullscreen poll. Keep application chrome until a grant,36
and use `window-fullscreen?` for acknowledged state rather than treating a true37
request result as success.39
The existing `(sigil ui wayland)` calls retain their behavior, including40
`wayland-set-title!` returning false for an identical title and41
`wayland-dispatch` emitting `(fullscreen configured?)` without status-only events.42
The portable dispatcher adds the service status without changing legacy events.44
Qualification uses an isolated Wayland protocol server and an owned headless45
compositor. AppKit host qualification belongs to sigil-window's Linux-built46
native/Sigil/WKWebView packet; its hidden-window controls use controlled47
transitions and a private named pasteboard. Real UI drawing with outline48
fonts requires the SDK-free sigil-font backend and its separate Mac gate.