# appframe

> A window frame for Compose Desktop that behaves like the platform it runs on, including asking GNOME where the buttons go instead of guessing.

Page: https://kotlin.website/appframe

## Why it exists

A custom title bar looks like a small job until you notice that "which side do the window
buttons go on" has three different right answers, and one of them is not knowable in advance.

## What it handles

- **macOS**: traffic lights on the left, dimmed when the window loses focus, glyphs revealed
  on hover — and the green button goes *fullscreen*, not maximize, which is one of the tells
  that an app was ported rather than written for the platform.
- **Windows 11**: the actual button metrics, including the red close-button hover.
- **Linux**: there is no convention, so the desktop is asked directly. The GTK
  `org.gnome.desktop.wm.preferences button-layout` setting decides both the side and **which
  buttons exist at all** — which is why a hardcoded three-button row looks wrong on stock
  GNOME rather than merely misplaced. Falls back to the right-hand layout when the setting
  cannot be read.
- **Maximize that respects the window manager** via `WindowPlacement.Maximized`, so docks and
  multi-monitor setups work; rounded corners where the platform expects them, squared off
  while maximized.

## Install

```kotlin
repositories { maven("https://reposilite.kotlin.website/releases") }
dependencies { implementation("io.github.youndie:appframe-desktop:<VERSION>") }
```

No icon dependency — every glyph is drawn with `Canvas`. Material 3 colours are taken from
whatever `MaterialTheme` it finds itself in, and it is a drop-in replacement for the `Window`
block you already have.
