Seamless window
Native edge-to-edge macOS chrome: no title bar, traffic lights kept, zero flash.
Content owns the whole window. The macOS title bar disappears as a bar, the three traffic lights stay — comfortably inset, native, draggable strip and all — and the decorated bar never appears, not even for one frame at launch.
The pairing
Two calls, both required. app.Decorated(false) makes Gio hide the
title bar natively — and, critically, stops Gio painting its own fallback decorations (on
Gio ≥ v0.8 it reads the window's full-size-content flag back and would otherwise draw a
client-side title bar over yours). MakeSeamlessWindow then adds what
Decorated(false) doesn't: it re-shows the traffic lights (Gio hides them), gives
them the comfortable unified-toolbar inset, and applies the titlebar transparency
before the first frame is presented, so there is no flash of decorated chrome.
Call it on every AppKitViewEvent — the symbol and the event both exist only on
macOS, so this lives in a main_darwin.go:
// main.go — create the window undecorated:
w := new(app.Window)
w.Option(app.Title("myapp"), app.Decorated(false))
// main_darwin.go — apply the seamless chrome:
case app.AppKitViewEvent:
lotusui.MakeSeamlessWindow(e.View)
What it does under the hood
Synchronously at view-attach (before the first present): transparent title
bar, hidden title, full-size content — the no-flash guarantee. On the next runloop tick: an
empty unified toolbar (the sanctioned way to get inset traffic lights that stay put across
resizes), a one-point frame nudge to force AppKit's relayout, and a brief re-assertion loop
that wins the race against Gio's own configure pass, which would hide the buttons again.
Everything is idempotent — calling it on every AppKitViewEvent is the intended
usage.
One doctrine note for apps that use this: Gio version bumps must be verified with a real launch on macOS — the pairing depends on how Gio's decoration handling reads the window's style mask, which has changed between Gio versions before.
API
| Option | Type | Description |
|---|---|---|
view | uintptr | The AppKit view from app.AppKitViewEvent — pass e.View; zero is ignored. |