Repository navigation
Description
Rev: c92e462 (dev)
Target: Linux, X11 and Wayland. Seen on Ubuntu with GNOME on Wayland, the app running under XWayland.
On macOS and Windows, App::titlebar makes the app's band the window's title bar: the traffic lights or the caption buttons sit over it, and .window_drag() regions move the window. On Linux the system's title bar stays, and Cx::chrome_insets reports zero, so the app's toolbar sits under a second bar with the app's name in it.
An app can't fix this itself. With WindowOptions decorations off, GNOME on Wayland draws nothing at all, because it has no server-side decorations. The window then has no minimize, maximize or close, and can't be resized from its edges.
Fix
892236b is one commit on dev c92e462, on branch linux-csd-titlebar of been-there-done-that/rune.
- No decorations. A Linux window with a titlebar opens with
with_decorations(false), and the app's band is its title bar, as on Windows.Cx::chrome_insetsreports the buttons' width and the band's height; headless runs draw the same. - Caption buttons. Rune draws minimize, maximize/restore and close at the trailing edge as round 24 pt buttons 12 pt apart, in the GNOME and KDE style (
window/titlebar/csd.rs):- they are plain elements, so they hover and press like any other;
- they keep the window's size at every
Cx::zoom, as the Windows buttons do; - their symbols take
Cx::caption_color, else the system's light or dark setting; - full screen hides them.
- Resize edges. A restored, resizable window gets a 6 pt band along each side and 12 pt squares at the corners (
window/csd.rs). The pointer there shows the resize cursor, and a press hands the resize to the window manager before the view sees it. - Moving.
.window_drag()regions move the window and maximize or restore it on a double click. A right click opens the compositor's window menu on Wayland; X11 has none. - Shared code. The Windows caption buttons' key, label and press action move into helpers that both frames use. macOS and Windows behaviour is unchanged.
- Docs and changelog. The
Titlebardocs, the crate README andexamples/custom_titlebar.rsdescribe the Linux frame;changelog/unreleased/2026-11-10-linux-client-titlebar.mdhas the entry.
The changelog entry also notes a trap: like on Windows, the buttons' symbols follow the system's light or dark setting. An app with its own light theme on a dark desktop gets white buttons on a white bar unless it sets Cx::caption_color.
Overlap with #93. #93 adds resize edges and minimize/maximize for borderless app windows on Windows and Linux. This change is for windows with App::titlebar, where Rune draws the buttons itself. Both add an edge band in window/events.rs, so whichever lands second should share the other's hit test.
Verified
cargo check -p rune --all-targetson x86_64 Linux: no new warnings.scripts/file-size.shpasses.- An app built on the commit, running on GNOME (Wayland, under XWayland): the system bar is gone, the three buttons draw at the toolbar's trailing edge, dragging the toolbar moves the window, and a double click maximizes and restores it.
csd_tests.rscovers the edge and corner hit test, the buttons' layout and the insets.
Not yet run: the full cargo test -p rune -p rune-kit --features rune-kit/markdown, a native Wayland (non-XWayland) session, KDE, and macOS or Windows builds of the commit.
Activity
been-there-done-that commentedon Nov 11, 2026
Test run on
892236b(x86_64 Linux, Ubuntu with GNOME on Wayland, Rust 1.99.1), using the documented commandcargo test -p rune -p rune-kit --features rune-kit/markdown:window/titlebar/csd_tests.rspass.devc92e462on the same machine, so they come from this machine's environment, not this change. For example,copy_select_all_and_the_context_menureads the desktop's real clipboard, and the sRGB, glyph and italic tests depend on the GPU and fonts.gpu_static_mips_alpha_clip_and_page_order_match_pixelsanda_fast_click_only_counts, failed only under the full parallel run. Run alone on892236bthey pass 3/3.By hand, in a real window (GNOME on Wayland, app under XWayland): minimize, maximize/restore and close work; the side and corner edges resize with the right cursors; dragging the toolbar moves the window; and a double click maximizes and restores it.
One thing an app has to do: if the app's theme doesn't follow the system's light/dark setting, it must call
Cx::caption_color. Without it, a light theme on a dark desktop draws white buttons on a white bar. The changelog entry says so.Hona commentedon Nov 24, 2026
Carrying over details from duplicate #993, which reports the same double-titlebar issue on native Wayland (GNOME 49 on Fedora 45, where winit draws its grey Adwaita bar above
App::titlebar) and links an alternative fork implementation. Two design notes from #993 worth keeping: checkingzxdg_decoration_manager_v1so Wayland compositors with server-side decorations (KDE, Hyprland, Sway) and X11 keep their native frames, and reading GNOME'sorg.gnome.desktop.wm.preferencesbutton-layoutthrough the settings portal to support close-only and left-side button layouts.feat(linux): the window's controls sit in the titlebar row under Rune…
feat(linux): the window's controls sit in the titlebar row under Rune…
feat(titlebar): App::titlebar is the window's only bar where a Waylan…
Hona commentedon Dec 1, 2026
Already fixed on
devvia #2244 (e16732a5f), removing the duplicate title bar on Wayland compositors withoutxdg-decoration(GNOME) and adding Rune caption buttons + resize edge bands. Follow-up shadow/corner polish is tracked separately in #2360. Closing as completed.