Skip to content

feat(linux): the window's controls sit in the titlebar row under Rune's own frame - #1183

Merged
Hona merged 3 commits into
devfrom
linux-chrome/titlebar-controls
Nov 25, 2026
Merged

Hona merged 3 commits into
devfrom
linux-chrome/titlebar-controls

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

On GNOME under Wayland the window had a second bar above OpenCode's own tab row. With Rune's own frame (anomalyco/rune#2244) the window's buttons sit in the titlebar row instead, as on Windows. Refs #1146.

The Rune pin on dev holds anomalyco/rune#2244 since #1257, so this change is what puts the buttons in the row. Under a native frame it changes nothing (Cx::chrome_insets stays zero there).

What changes

Top tabs Side tabs / inbox Narrow window
Linux, native frame (X11, KDE, Sway, Hyprland) system bar + 36 pt row system bar, no row system bar + 36 pt row
Linux, Rune's frame (GNOME Wayland) one 44 pt row: app menu, Home, Search, tabs, +, window buttons one 44 pt row: app menu, sidebar toggle, window buttons one 44 pt row at the top
  • shell/view/chrome.rs: caption_row = Windows, or Linux with chrome_insets().height > 0. Then the row is Windows' (44 pt at every layout, 1 pt above the panels). A narrow window's row stays at the top there: along the foot the buttons would sit over the panels.
  • shell/view/titlebar.rs: the row's leading padding follows caption_row, not the platform.
  • The buttons' room comes from chrome_insets().trailing, or .leading where the desktop puts them on the left: the row already kept clear of both.
  • Full screen (F11): the buttons go, the row stays, as on Windows.

Verification

Headless mutter; not shown on a real GNOME desktop.

  • CI run 45712819442 on 5d7b4cb3d: plan, guardrails, macOS, Windows x64, Windows arm64, and Linux x64 green; Linux arm64 skipped.
  • Headless GNOME Shell 46.0 on mutter 46.2 (0.0.0-pr-1183-2626, software rendering, no override variable):
    • Top tabs: one 44 px bar at the window's own top (y=0..43, content border at y=44); app menu, Home, Search, tab, + on the left; minimize, maximize, close once on the right, no overlap; zero decoration requests.
    • Drag region (y=22): held drag moved the window at all three points (after +, middle of gap, 20 pt left of minimize); double click maximized (0,32 1600x968) and restored (100,150 1200x800).
    • Press actions: Maximize (set_maximized, restore icon shown) and back (unset_maximized); right click opened mutter's window menu (show_window_menu); Minimize (set_minimized); Close exited 0.
    • Side tabs (--tab-layout vertical): one 44 px bar with app menu, sidebar toggle, and the three buttons; panels directly under it; drag moved the window; Maximize and restore worked; Close exited 0.

Difference from OpenCode Desktop

Desktop keeps the system's frame on Linux (packages/desktop/src/main/windows/defaults.ts: platformFrame sets nothing there), so it has the two bars on GNOME. One row is ours.

Not covered

The row layout is the one @zce's proof of concept showed. Thank you.

…'s own frame

On GNOME under Wayland the compositor draws no window frame, and the window had
a second bar above the app's own tab row. Once Rune draws its own frame there
(anomalyco/rune#591), `Cx::chrome_insets` has a height on Linux, and the shell
takes Windows' layout: a 44 pt titlebar row in every tab layout, with the app
menu (and the sidebar toggle beside side tabs) at its start and room for the
window's buttons at its end, or at its start where the desktop puts them left.
A narrow window keeps that row at its top.

Under X11 and under compositors that draw the frame themselves (KDE, Sway,
Hyprland) the insets stay zero and nothing changes; neither do macOS and
Windows. Until the Rune pin holds the frame this does nothing on Linux either.

OpenCode Desktop keeps the system's frame on Linux, so this row is a
difference from it.

The layout is the one zce's proof of concept for #1146 showed.

Co-authored-by: Lei <[email protected]>
@zce

zce commented Nov 25, 2026

Copy link
Copy Markdown

I ran the #1184 build on a real GNOME desktop (Fedora 45, GNOME 51.1, Wayland). The single 44 pt row, the close-only default and live button-layout changes, close/maximize/restore, and F11 with the buttons gone all behaved as described. Full report and screenshots: #1184 (comment)

The one gap is real-pointer titlebar drag, edge resize and double-click maximize: --window-script has no Wayland serial, so I couldn't exercise those from a script.

@zce

zce commented Nov 25, 2026

Copy link
Copy Markdown

Follow-up from the same real-GNOME run: double-clicking the titlebar does not toggle maximize/restore. The row itself is fine — the first press hands the drag to Mutter before the second press can arrive, which is Rune's side, reported at anomalyco/rune#2244 (comment).

@Hona
Hona marked this pull request as ready for review November 25, 2026 23:00
@Hona
Hona merged commit da3edd7 into dev Nov 25, 2026
7 checks passed
@Hona
Hona deleted the linux-chrome/titlebar-controls branch November 25, 2026 23:01
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.

2 participants