Skip to content

Linux: App::titlebar gets winit's grey Adwaita bar on GNOME instead of the app's own frame #993

Duplicate

Description

@jamesponwith

On GNOME (Wayland), a window with App::titlebar gets winit's own frame: mutter offers no xdg-decoration, so winit draws its light grey Adwaita bar (no title, since Rune builds winit with wayland-csd-adwaita-notitle) above the app's titlebar. A dark app ends up under a blank grey band, with a lone close button.

Suggested change, one commit on dev: jamesponwith/rune@dev...linux-client-titlebar (41a985c4). Opening a pull request here isn't allowed for outside accounts, so it's linked instead; happy to adjust it to whatever shape you prefer.

It draws the app's own frame there, the way Windows already does for App::titlebar:

  • When: a window with App::titlebar, not borderless, on Wayland, where the compositor lacks zxdg_decoration_manager_v1 (asked once on winit's own connection, titlebar::linux::server_decorates). The window is made with with_decorations(false), so winit never draws its bar. KDE, Hyprland and Sway offer server-side decorations and keep theirs; X11 keeps its window manager's frame. Apps without App::titlebar are unchanged.
  • Caption buttons: the existing Caption and titlebar::frame path, with a ButtonLayout from GNOME's org.gnome.desktop.wm.preferences button-layout, read through the settings portal in the same first read as color-scheme (portal_appearance). appmenu:close, GNOME's default, is close alone; a layout on the left draws mirrored. The buttons are libadwaita's shape: a 24 pt circle washed with Cx::caption_color at 10%, 15% under the pointer, with the Windows symbols in it. They are ordinary elements, so the pointer presses them through on_press (Tx::minimize, Tx::toggle_maximized, Tx::close_window). Cx::chrome_insets reports their room and the titlebar's height.
  • Resize edges: a 5 pt band inside each side, 16 pt along a corner for the diagonals (titlebar::linux::edge_at). Over it the host shows the resize cursor (OsCursor::set_override) and a primary press calls drag_resize_window instead of reaching the view. A maximized, full-screen or fixed-size window has none.
  • Drag and double click already worked through .window_drag() and titlebar_double_click.

Not here: a client-side shadow and rounded corners (the window is square and shadowless on GNOME, as a borderless one is today), the window menu on right click (winit 0.30 has no show_window_menu on Wayland), and following a button-layout change while a window is open (it shows in windows opened after it).

Checked:

  • cargo test -p rune --lib titlebar on macOS (the two new tests in titlebar/linux_tests.rs: layout parsing and edge hit-testing, plus the existing titlebar tests).
  • cargo check and cargo clippy -p rune --features dbus on Arch Linux (no new warnings).
  • In an app that sets App::titlebar (Phux Rune), on a Fedora 45 Workstation live session (GNOME 49, Wayland): no grey bar; appmenu:close shows close alone; appmenu:minimize,maximize,close shows all three at the right, and each works; close,minimize,maximize: puts them at the left; dragging the titlebar moves the window; dragging the right edge resizes it; the buttons follow the app's light and dark inks live.
  • On Hyprland, WAYLAND_DEBUG=1 shows the toplevel still asking for and getting server-side mode (set_mode(2), configure(2)), so nothing changes there.

Activity

  1. Hona commented on Nov 24, 2026

    @Hona
    Member

    Closing as a duplicate of #591, which tracks replacing the system/winit title bar with Rune's own client-side frame for App::titlebar on Linux. Your native Wayland GNOME 49 report, the zxdg_decoration_manager_v1 check to preserve native frames on SSD compositors and X11, GNOME portal button-layout support, and pointer to your fork implementation have been carried over to #591 so nothing is lost. Thanks for putting that together!

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