Skip to content

GNOME Wayland: put the window controls in OpenCode's titlebar #1146

Done

Description

@zce

On Fedora 45 Workstation with GNOME and native Wayland, Rune falls back to winit's Adwaita window decorations. With Top tabs, that puts a separate decoration bar above OpenCode's own tab row. I'd like the layout the Windows build already has: one titlebar with the window controls at the end, without losing titlebar dragging or edge resizing.

The windowing part is already tracked in anomalyco/rune#591. Rune #993, closed as a duplicate, covers the native GNOME Wayland case specifically. OpenCode already sets App::titlebar. Once Rune supplies its own frame on these compositors, the app can use Cx::chrome_insets() to leave room for the controls in both top- and side-tab layouts, while keeping the normal decorations on X11 and on Wayland compositors that provide them.

I have a downstream proof of concept that builds a Fedora RPM against the pinned Rune revision. I checked the top- and side-tab layouts with the offline fixture under Weston in Podman and verified the RPM payload. The local packaging is just a way to try the change; this issue is to track the app-side follow-up when the Rune fix is available.

Prototype screenshot

Top tabs with the integrated window controls, captured using the offline fixture under Weston in Podman.

preview

Activity

  1. Hona commented on Nov 25, 2026

    @Hona
    Member

    Thanks for the write-up and the proof of concept, @zce: it made this quick. Two drafts are up:

    Two things differ from your prototype:

    • Buttons follow GNOME's button-layout. On a default GNOME that is close alone, at the right, as in other GNOME apps; with minimize and maximize turned on (Tweaks), or a left-side layout, the row follows, also while the app runs.
    • Round buttons in place of the Windows-style ones.

    Not covered yet: the window has no shadow and square corners on GNOME, and it resizes from a 5 pt band inside its edges, not from outside. Both builds compile on Linux; neither has been run on a real GNOME desktop yet, so that is the next step before anything merges.

  2. zce commented on Nov 26, 2026

    @zce
    Author

    Frame status from a real GNOME desktop (Fedora 45, GNOME Shell 51.1, mutter 51.1, Wayland): rune#2360's shadow and rounded corners work with the app's own titlebar; no separate Adwaita bar above the tabs, and no inside resize band.

    The 1 pt white border in my earlier pictures was not the frame: sctk-adwaita's ColorTheme::auto() reads org.freedesktop.appearance color-scheme with dbus-send, which this install doesn't have, so a saved System scheme got the light border around a dark app. The fix is zce/rune@7824acd (one commit on dev, proposed in rune#2360) plus #1293 for the app's scheme hand-off. With both, the frame is dark from the first frame and follows a live light/dark switch.

    Still open on rune#2360: tiled edges and fractional scaling. The window controls/layout are the remaining piece of this issue; the frame is no longer in their way.

  3. Hona commented on Nov 27, 2026

    @Hona
    Member

    Closing as completed — the integrated GNOME Wayland titlebar controls requested here are already shipped on dev:

    • App-side titlebar layout (feat(linux): the window's controls sit in the titlebar row under Rune's own frame #1183, da3edd75): On Wayland compositors where Rune draws its own frame (Cx::chrome_insets().height > 0), OpenCode uses a single 44 pt titlebar row across top-tab, side-tab/inbox, and narrow layouts, leaves leading/trailing room for the controls via Cx::chrome_insets(), hides the buttons in F11 full screen while keeping the row, and leaves X11 and server-side-decorated Wayland compositors (KDE, Sway, Hyprland) unchanged.
    • Rune windowing support (pinned since fix(deps): pin rune to 5342f14d (93 commits): window buttons on Wayland without server decorations, smaller backdrop blur copies #1257, affe876f; dev is now at Rune 09573910): Includes anomalyco/rune#2244 (removes winit's separate Adwaita bar on GNOME Wayland, draws round caption buttons following GNOME's live button-layout via the settings portal, and provides a 5 pt inside resize band), anomalyco/rune#2252 (8 pt drag threshold so titlebar double-click maximizes/restores), anomalyco/rune#2271 (right-click window menu), and anomalyco/rune#2249/#2293 (compositor window actions and tiled edges).

    #1183 referenced this issue with Refs #1146 rather than Fixes #1146, so it stayed open after merge.

    Verification & upstream follow-up:

    Please reopen (or file a new issue) if anything in the titlebar controls or layout is still off on current dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions