Skip to content

Client-side window decorations on Linux - #7

Open
zahariash wants to merge 1 commit into
LadybugDB:mainfrom
zahariash:wayland-client-decorations
Open

zahariash wants to merge 1 commit into
LadybugDB:mainfrom
zahariash:wayland-client-decorations

Conversation

@zahariash

Copy link
Copy Markdown

On GNOME Wayland the window has no title bar, so it can't be moved, resized or closed with the mouse (issue #6).
Mutter doesn't implement xdg-decoration, and GPUI's default server-side request leaves window_decorations() reporting Server, so nothing draws a frame.

This requests WindowDecorations::Client on Linux (as Zed does) and adds src/decorations.rs, active only when GPUI reports Decorations::Client:

  • resize border on edges and corners, plus a 1px border and shadow (dropped when maximised or tiled)
  • the header's title area drags the window; double-click maximises, right-click opens the window menu
  • minimise / maximise / close buttons in the header

No-op on macOS, Windows and X11 without a compositor.

Tested on Ubuntu 24.04, GNOME 46 on Wayland. cargo fmt, clippy -D warnings and cargo test --lib pass. Not tested on KDE or wlroots.

after

GNOME/Mutter on Wayland does not implement xdg-decoration, so the window
had no title bar: it could not be moved, resized or closed with the
mouse. GPUI's default request for server-side decorations also makes
`window_decorations()` report `Server` there, so nothing drew a frame.

On Linux the window now requests client-side decorations. When GPUI
reports `Decorations::Client`:
- an invisible 8px border resizes the window (edges and corners, with
  resize cursors), plus a 1px border and shadow while not tiled;
- the header's title/status area drags the window, double-click
  maximizes/restores, right-click opens the compositor window menu;
- minimize / maximize / close buttons in the GNOME header-bar style
  (round, path-drawn icons) are appended to the header.

Where the platform draws the frame (macOS, Windows, X11 without a
compositor) all of this is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant