You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Window menu on X11, and tiled states on X11 and Wayland #313
Goal: Make custom Linux titlebars follow the window manager’s menu, decoration and tiling behavior.
Gap: Rune’s window-menu path is Windows-only, and views cannot read negotiated decorations, tiled edges or available window actions.
Request: Add an X11 titlebar-menu path using _GTK_SHOW_WINDOW_MENU when advertised. Separately expose actual decoration mode, tiled edges and action availability where the backend provides them, preserving unknown values. Use per-window action information on X11 and coordinate Wayland support with winit. Do not infer decoration mode from missing capabilities.
From Strata (lgse/strata), a file manager on Rune that draws its own header: on Wayland the window menu is missing as well. chrome::window_menu (window/chrome.rs:138-155 at 67d73a5f) is still Windows-only, so a right-click on a .window_drag() region opens nothing on Linux. winit's Wayland show_window_menu already sends xdg_toplevel.show_window_menu, which GNOME and KDE expect; Rune doesn't call it.
One more piece would let a custom header match the desktop: the desktop's titlebar double-click action (org.gnome.desktop.wm.preferences action-double-click-titlebar, also in the Settings portal), instead of always maximising (titlebar_double_click, window/chrome.rs:106-111 at 67d73a5f).
Thanks for the clear write-up. I checked, and the gap is real:
window_menu and has_window_menu in crates/rune/src/window/chrome.rs only work on Windows. On Linux they do nothing, so a right-click or Alt+Space on a custom titlebar opens no menu.
In the vendored winit, show_window_menu is empty on X11. On Wayland it does send xdg_toplevel.show_window_menu, but Rune never calls it, as @wmfeht points out.
Views can't currently read the decoration mode the compositor chose, tiled edges, or which window actions are available.
I'll treat this as a feature request in these parts:
On X11, open the window manager's menu with _GTK_SHOW_WINDOW_MENU, but only when the window manager advertises it.
On Wayland, call winit's show_window_menu for the same titlebar and keyboard paths.
Expose decoration mode, tiled edges and action availability only where the backend reports them, keeping "unknown" as its own value. Decoration mode won't be inferred from missing capabilities. On X11, action availability will be read per window.
The Wayland state may need changes in winit. The desktop's titlebar double-click setting from the comment is a related follow-up.
I've opened a PR for the window-menu half of this:
Wayland: a right-click on a bare .window_drag() region, or Alt+Space that no handler takes, now calls winit's show_window_menu (xdg_toplevel.show_window_menu). That should also cover the Strata case @wmfeht described.
X11: Rune sends _GTK_SHOW_WINDOW_MENU itself, only when the window manager lists it in _NET_SUPPORTED. winit's X11 show_window_menu does nothing.
The change hasn't been compiled or tested yet, so it needs a build and a try on a real desktop before merging. Reading the decoration mode, tiled edges and available actions isn't in this PR: it needs its own API with an explicit "unknown" value, and on Wayland it depends on winit exposing that state.
Tested #2196 live: the window menu does not open from a custom titlebar on GNOME, on Wayland or on X11.
Setup: Rune dev at 4f8a7d14, cargo run -p rune --example custom_titlebar, on Ubuntu 26.04 with GNOME Shell 50.1, scale 1. On X11 the test ran through XWayland, whose window manager lists _GTK_SHOW_WINDOW_MENU in _NET_SUPPORTED. Input came from Mutter's RemoteDesktop API, and screenshots came from its ScreenCast stream.
Action
Wayland
X11
Left-click on the band's Theme button
the theme switches
the theme switches
Right-click on a bare part of the .window_drag() band, between the title text and the buttons
no window menu
no window menu
Right-click on GNOME's own title bar above the band
GNOME's window menu opens
GNOME's window menu opens
The first row shows that input reaches the window. The build passes, and the 5 window_menu unit tests pass. The example reports chrome insets of 0 on both backends, and GNOME keeps its own decorations: server-side on X11 and client-side on Wayland. So the window shows two title bars, and the band may never act as a titlebar on Linux. Could you reopen this issue, or tell us which setup #2196 expects?
Thanks for testing this so carefully. You're right: #2196 doesn't open the menu on Linux. It isn't your setup.
Why:secondary_region_down (crates/rune/src/runtime/input/titlebar.rs) only treats a right-press on a .window_drag() region as a titlebar press while the runtime has a caption. Only the Windows custom frame sets one (caption() in window/chrome.rs returns None elsewhere). On Linux the release never asks for the window menu, so the new Wayland (xdg_toplevel.show_window_menu) and X11 (_GTK_SHOW_WINDOW_MENU) code never runs. The unit tests only cover building the X11 message and the _NET_SUPPORTED check, so they missed this. That's a gap in #2196.
Setup: the two title bars and zero chrome insets are expected today. On Linux, App::titlebar keeps the native frame (see the README's App::titlebar entry), so that band never replaces the title bar. The setup #2196 was meant for is a borderless window (WindowSpec { borderless: true, .. }) whose header uses .window_drag() regions, like Strata's. The same caption check blocks that case too, so it won't work there yet either.
This should be reopened. On Linux the check needs to depend on whether the window can show a window menu, not on the Windows caption. The decoration-mode, tiled-edge and window-action half of this issue was never done either.
When the caption check is fixed, we can test a borderless window (WindowSpec { borderless: true, .. }) live on GNOME, on Wayland and on X11, and report here.
Thanks, a borderless window (WindowSpec { borderless: true, .. }) is the right setup to test. Once a fix for the caption check lands, these are the checks that would tell us the most, on both Wayland and X11:
Right-click on a bare part of a .window_drag() region. GNOME's window menu should open at the pointer.
Right-click on a child that has its own press handler (a button in the header). There should be no window menu.
Alt+Space with the window focused. On GNOME the shell's own Alt+Space binding probably opens the menu before Rune sees the key. If it reaches the app, the menu should open at the window's top-left corner.
The menu items themselves. Move, Resize, Maximize and Close should work on the borderless window.
For anything that fails, a note of which backend it was would be enough.
The reactive window-manager state API and its X11 backend are now on dev in #2249 (0ade7deab).
On dev now (X11):
Cx::decoration_mode() -> DecorationMode (Unknown / Server / Client), read from _NET_FRAME_EXTENTS (never inferred from missing actions or is_decorated()).
Cx::tiled_edges() -> Option<TiledEdges> (None when unknown, Some(TiledEdges::NONE) when untiled), read from _GTK_EDGE_CONSTRAINTS (bits 0=top, 2=right, 4=bottom, 6=left; matching Chromium Linux, GTK4, and libadwaita).
Cx::window_actions() -> WindowActions (window_menu, maximize, minimize, fullscreen, close, each Option<bool>), read from per-window _NET_WM_ALLOWED_ACTIONS and root _NET_SUPPORTED (_GTK_SHOW_WINDOW_MENU).
Views that read any of the three (and their memo closures) rebuild automatically on change; views that never read them do no extra work. Wayland, macOS, Windows, and web currently report Unknown / None.
cargo run -p rune --example custom_titlebar also displays these three values live.
What to try on X11 / XWayland (not run on a live desktop here — verified via unit tests, doctests, and Linux container / macOS / Windows / wasm32 builds):
Tile left and tile right: verify tiled_edges reports Some(TiledEdges { top: true, right: false, bottom: true, left: true }) on left half and { top: true, right: true, bottom: true, left: false } on right half, and Some(TiledEdges::NONE) when untiled.
Maximize and restore: verify cx.is_maximized() flips without falsely setting tiled edges when untiled.
A window or WM rule that forbids maximize (e.g. non-resizable window): verify window_actions().maximize reports Some(false) while other allowed actions stay Some(true).
Server-side decorations (default titled window) vs. client-side / borderless (WindowOptions { borderless: true, .. }): verify decoration_mode() reports Server when _NET_FRAME_EXTENTS is non-zero and Client when it is [0, 0, 0, 0] (or Unknown if unset).
Leaving this issue open for the remaining pieces: Wayland xdg-decoration / xdg_toplevel configure state + X11 PropertyNotify wake in the next PR, the Linux custom-titlebar window-menu repair, and live GNOME X11/Wayland confirmation.
Tested #2249 live on X11: dev at 0ade7deab, on XWayland under GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1. A small app logged decoration_mode(), tiled_edges(), is_maximized() and window_actions() on every change. GNOME's shortcuts drove it through Mutter's RemoteDesktop API. Screenshots confirmed that each tile and maximize happened.
Check
Titled window (default)
Borderless window
Not resizable
4. decoration_mode()
Unknown for the first frame, then Server ✅
stays Unknown ❌ (expected Client)
Server ✅
1. Tile left (Super+Left)
stays NONE, though the window visibly tiled ❌
top + bottom only; left is false ❌
not tested
1. Tile right (Super+Right)
stays NONE ❌
top + bottom only; right is false ❌
not tested
1. Untile (Super+Down)
NONE ✅
NONE ✅
not tested
2. Maximize / restore (Super+Up / Super+Down)
is_maximized() flips both ways, and tiled_edges stays NONE ✅
is_maximized() flips both ways, and tiled_edges reports all four edges while maximized, NONE after restore
not tested
3. window_actions().maximize
Some(true)
Some(true)
Some(false) ✅ (and fullscreen is Some(false))
Summary:
On a titled window, tiling is never reported.
On a borderless window, tiling reports only top and bottom, never the side that touches the screen edge.
A borderless window's decoration mode stays Unknown.
Maximize, restore and the allowed-actions check work.
A fix for the Linux window-menu trigger is now on dev in #2271 (b16605c7b).
What changed:
Removed the Windows-only caption check that blocked right-clicks on bare .window_drag() regions on Linux (both borderless windows and App::titlebar).
Wayland:xdg_toplevel.show_window_menu now fires on right-button press instead of release, while winit still holds the button-press serial (calling it on release sent the release serial, which compositors checking the implicit-grab serial ignore). Touch long-press now also passes the touch position rather than (0, 0).
About the two title bars in custom_titlebar: that is expected today. On Linux, App::titlebar keeps the native frame (see the App::titlebar / WindowSpec::titlebar entry in crates/rune/README.md, which notes zero Cx::chrome_insets() where the native frame stays), while a custom .window_drag() header is intended for a borderless window (WindowSpec { borderless: true, .. }).
What could not be verified here: we have no live Linux desktop (Wayland or X11 display server) in this run, so #2271 is verified by headless unit tests and Linux container compilation/clippy, not seen live on GNOME. Could you repeat your table on dev at b16605c7b on both Wayland and X11:
On a borderless window (WindowSpec { borderless: true, .. }) with a .window_drag() header (bare band right-click, button inside the band right-click, and menu actions like Move / Resize / Maximize / Close).
On cargo run -p rune --example custom_titlebar as it is (with GNOME's native frame kept).
Leaving this issue open for live confirmation and the remaining Wayland decoration-mode / tiled-edges / window-actions work.
Retested #2271 live: dev at b16605c7b, GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1, on Wayland and on X11 (XWayland). Input came from Mutter's RemoteDesktop API. The table's results come from screenshots taken through its ScreenCast stream, and from the app's own log.
1. A borderless window (WindowOptions { borderless: true, .. }) with a 44 pt .window_drag() header band and a button in the band.
Check
Wayland
X11
Right-click on the bare band
GNOME's window menu opens at the pointer ✅
✅
Right-click on the band's button
no menu ✅
no menu ✅
Left-click on the band's button
the button's press runs ✅
✅
Menu ▸ Maximize
is_maximized() becomes true ✅
✅
Menu ▸ Move, then Right ×10 and Return
the window moves right ✅
✅
Menu ▸ Resize, then Right ×10 and Return
the window grows wider ✅
✅
Menu ▸ Close
the app exits ✅
✅
2. cargo run -p rune --example custom_titlebar, unchanged, with GNOME's frame kept. A right-click on the bare part of the app's band opens GNOME's window menu, on Wayland and on X11 ✅.
Not separated: we did not test press timing apart from release timing. Each click was a press and a release 80 ms apart, so this test does not show that Wayland opens the menu on press and X11 on release.
Thanks for testing #2249 live and posting the table — that pinpointed all four X11 gaps right away. Both the X11 fixes and the Wayland backend are now on dev in #2283 (6bee31712), and the Linux custom-titlebar window-menu repair is also on dev in #2271 (b16605c7b).
(Apps pinning dev need to update their [patch.crates-io]winit rev to 6bee31712 or newer because vendor/winit.patch was updated.)
Titled window tiling stayed NONE: Mutter's update_gtk_edge_constraints (src/x11/window-x11.c) writes _GTK_EDGE_CONSTRAINTS on the reparented frame parent (priv->frame->xwindow), not on the client window. Rune now falls back to the reparented parent frame when the client window has no _GTK_EDGE_CONSTRAINTS. (Note: when maximized, Mutter writes 0x55 — all four edges constrained — on both titled and borderless windows, matching GTK4 and Chromium, and 0xAA / NONE on restore.)
Borderless half-tiling missed left / right: On Ubuntu 26.04, ubuntu-tiling-assistant handles Super+Left/Right via set_maximize_flags(VERTICAL) on a half-width frame instead of meta_window_tile, so Mutter writes only TOP_TILED | BOTTOM_TILED (0x99) plus _NET_WM_STATE_MAXIMIZED_VERT. Rune now refines _NET_WM_STATE_MAXIMIZED_VERT (without HORZ, and the horizontal twin) against _NET_WORKAREA intersected with the active monitor rect so flush left/right edges are reported without affecting floating vertically-maximized windows.
Borderless decoration_mode() stayed Unknown: Mutter omits _NET_FRAME_EXTENTS on frameless windows (priv->frame == NULL). When _NET_FRAME_EXTENTS is absent, Rune now reports DecorationMode::Client if the app requested no native frame (borderless: true), an EWMH WM is managing the window, and it was not reparented into a WM frame (titled windows without _NET_FRAME_EXTENTS stay Unknown).
First-frame Unknown → Server timing: Frame 1 before Mutter finishes mapping and framing the window is genuinely Unknown on X11; vendored winit now wakes Rune on PropertyNotify for _NET_FRAME_EXTENTS, _NET_WM_STATE, _NET_WM_ALLOWED_ACTIONS, and _GTK_EDGE_CONSTRAINTS so the update arrives as soon as Mutter writes the property even without a resize or focus change (zero X11 IPC on ordinary redraws).
Cx::decoration_mode() reads xdg-decoration / xdg_toplevel configure mode directly (Unknown before initial configure, Server or Client afterwards).
Cx::tiled_edges() reads xdg_toplevelTILED_* states on xdg_toplevel v2+ (None below v2 or before initial configure).
Cx::window_actions() reads xdg_toplevel::wm_capabilities (window_menu, maximize, minimize, fullscreen; close stays None) on xdg_toplevel v5+ (None below v5 so sctk's default all() never leaks).
Decoration-mode or capability changes without a resize wake sync_chrome_core. Layer-shell overlays are not toplevels and remain Unknown / None.
cargo run -p rune --example custom_titlebar shows the live wm: readout. None of this has been run on a live Wayland or X11 desktop here (verified via cross-platform unit tests, doctests, wasm32/WebGL2, macOS, Windows, and Linux container builds only).
Could you run three quick checks on dev (6bee31712)?
Retested #2283 live: dev at 6bee31712, GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1, Wayland and X11 (XWayland).
Setup: a small app logged decoration_mode(), tiled_edges(), is_maximized(), is_full_screen() and window_actions() on every change. Its window has a 44 pt .window_drag() band, and F calls Tx::toggle_full_screen.
Input: Mutter's RemoteDesktop API sent GNOME's shortcuts and the pointer drags.
Proof: screenshots from its ScreenCast stream confirmed each tile, move and resize.
1. X11: every gap from the last table is fixed.
Check
Titled
Borderless
Not resizable
decoration_mode()
Server ✅
Client ✅
Unknown for the first frame, then Server ✅
Super+Left
top, bottom, left ✅
top, bottom, left ✅
no change (the WM refuses) ✅
Super+Right
top, right, bottom ✅
top, right, bottom ✅
no change ✅
Super+Down (untile)
NONE ✅
NONE ✅
—
Super+Up / Super+Down
is_maximized() flips; edges NONE while maximized ✅
flips; all four edges while maximized
no change ✅
Full screen (F, twice)
is_full_screen() flips both ways ✅
✅
not allowed ✅
window_actions()
max, min, full, close: Some(true)
the same
maximize: Some(false), fullscreen: Some(false) ✅
Two small things on X11:
In full screen, a titled window reports decoration_mode() == Client, and maximize: Some(false). Right after leaving full screen, one frame still reports Client before it returns to Server.
While maximized, a titled window reports no tiled edges, but a borderless window reports all four.
2. Wayland
Check
Titled (client-side)
Borderless
Not resizable
decoration_mode()
Client ✅
Client ✅
Client ✅
Super+Left, or a drag to the left edge
top + bottom only; left is false ❌
top + bottom only ❌
no change
Super+Right, or a drag to the right edge
top + bottom only; right is false ❌
top + bottom only ❌
no change
Super+Down (untile)
NONE ✅
NONE ✅
—
Super+Up / Super+Down
is_maximized() flips; all four edges while maximized ✅
✅
no change
Full screen (F, twice)
is_full_screen() flips both ways ✅
✅
✅
window_actions()
close: None on every window, while X11 gives Some(true)
the same
maximize: Some(true) ❌ (expected Some(false); the WM refused Super+Up)
Screenshots confirm that both the keyboard and the drags tiled the window to the correct half. Only the side edge is missing from tiled_edges().
3. Window menu: unchanged, every check passes on both backends.
On the borderless window, a right-click on the bare band opens GNOME's menu at the pointer, and a right-click on the band's button opens none.
A left-click on the button still runs its press.
Maximize, Move (Right ×10, Return), Resize (Right ×10, Return) and Close all work.
In custom_titlebar with GNOME's frame kept, a right-click on the app's band opens the menu.
Thanks again for the thorough Wayland and X11 tables — every X11 fix from #2283 held on live Mutter because of them. The follow-up fixes for the five remaining items are now on dev in #2293 (cb2f50056, with no vendor/winit.patch change).
Mutter's src/wayland/meta-wayland-xdg-shell.c (fill_states) emits XDG_TOPLEVEL_STATE_TILED_* directly from window->edge_constraints (and Wayland maximize already reported all four edges through the same sctk/winit path, confirming TILED_LEFT/TILED_RIGHT are not dropped).
On Ubuntu 26.04, ubuntu-tiling-assistant (tilingWindowManager.js) handles half-tiles by calling window.set_maximize_flags(VERTICAL) while skipping override_constraints, so Mutter only sets top and bottom constraints and never sends TILED_LEFT or TILED_RIGHT.
Because Wayland intentionally hides global window position, both GTK4 (gdk/wayland/gdktoplevel-wayland.c) and Chromium (ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc) pass through the compositor's TILED_* states verbatim with no guess. Rune documents this limit on Cx::tiled_edges().
Wayland window_actions().maximize on a non-resizable window — fixed:
Mutter sends all four xdg_toplevel.wm_capabilities unconditionally before initial configure (compositor support, not per-window resizability).
Rune now combines WM_CAPABILITIES_MAXIMIZE with window.is_resizable() && window.enabled_buttons().contains(WindowButtons::MAXIMIZE) (matching GTK4's gtk/gtkwindowcontrols.c), so non-resizable Wayland windows report maximize: Some(false) while fullscreen remains Some(true) where Mutter allows it.
Wayland window_actions().close — fixed:
xdg-shell has no close capability because a Wayland client can always close its own toplevel. Following GTK4's deletable property (gtk/gtkwindowcontrols.c), Rune now reports close: Some(true) once a Wayland toplevel is configured (and Some(false) only if the close button is disabled; None pre-configure or on overlays), matching X11 so one title bar works on both backends.
X11 titled window decoration_mode() in full screen and 1 frame after leaving — fixed:
In full screen on X11, mutter-x11-frames collapses frame borders to [0, 0, 0, 0], and on exit _NET_WM_STATE_FULLSCREEN clears before _NET_FRAME_EXTENTS is asynchronously restored to [0, 0, 37, 0].
Rune now preserves the last confirmed non-fullscreen DecorationMode during full screen and across the 1-frame restore window while the titled window remains reparented in its WM frame (keeping window_actions().maximize == Some(false) in full screen as Mutter reports).
X11 titled window tiled_edges() while maximized — fixed:
Always reads _GTK_EDGE_CONSTRAINTS from the reparented parent frame (priv->frame->xwindow) when has_wm_frame is true (preferring it over any stale pre-frame client property) and reports Some(TiledEdges::ALL) when _NET_WM_STATE has both MAXIMIZED_HORZ and MAXIMIZED_VERT, matching GTK4, Mutter's update_edge_constraints, Chromium's X11Window::GetTiledState, borderless X11, and Wayland.
(No live GNOME Wayland or X11 desktop was run here — verified via cross-platform unit tests, doctests, wasm32/WebGL2 + strict lints, Windows, macOS, and Linux container builds only.)
Short repeat on dev (cb2f50056)
Wayland half-tile row: if you can grab one line of WAYLAND_DEBUG=1 showing xdg_toplevel@*.configure's states array for a left tile (with Ubuntu Tiling Assistant on, and if convenient, off), that will confirm item 1 completely.
Wayland window_actions(): confirm close: Some(true) on every window, and on the non-resizable window maximize: Some(false) with fullscreen: Some(true).
X11 titled full screen (F, twice): confirm decoration_mode() stays Server throughout full screen and immediately after leaving (no 1-frame Client), with maximize: Some(false) while full screen.
Maximized row (Super+Up / Super+Down): confirm X11 titled, X11 borderless, and Wayland all report all four edges while maximized and NONE after restore.
log: xdg_toplevel#34.configure(926, 1048, array[12]), which is 3 states;
tiled_edges(): top and bottom.
With the tiling assistant off:
log: xdg_toplevel#34.configure(927, 1048, array[16]), which is 4 states;
tiled_edges(): top, bottom and left ✅.
So Rune reports what the compositor sends, and the missing side edge comes from the tiling assistant, as you said. We turned the assistant back on after the test.
2. Wayland window_actions().
close: Some(true) on the titled, borderless and non-resizable windows ✅.
The non-resizable window gives maximize: Some(false) ✅ and fullscreen: Some(true) ✅.
3. X11 titled full screen (F twice).
decoration_mode() stays Server throughout, with no Client frame on entering or leaving ✅.
maximize: Some(false) while in full screen, and Some(true) after ✅.
4. Maximize with Super+Up, then restore with Super+Down. X11 titled, X11 borderless, Wayland titled and Wayland borderless all report all four edges and is_maximized() while maximized, then NONE after the restore ✅.
Everything requested in this issue is now on current dev: Cx::decoration_mode(), Cx::tiled_edges(), Cx::window_actions(), and the Linux window menu on bare .window_drag() regions for both X11 (_GTK_SHOW_WINDOW_MENU) and Wayland (xdg_toplevel.show_window_menu).
cargo run -p rune --example custom_titlebar shows the live readout. Apps pinning dev should update their [patch.crates-io]winit rev to 6bee31712 or newer.
All of these were confirmed live on a GNOME desktop on both X11 and Wayland by a reporter in this thread—thank you for three rounds of tables in one day, which got both backends right. One documented limit: on Wayland, Ubuntu's default tiling assistant extension sends only top and bottom states on half tiles, so Rune reports top and bottom verbatim; with the extension off, the compositor sends the side edge too and Rune reports it.
Not yet tested live: other desktops and window managers (KDE, Sway, Hyprland, or a tiling X11 WM), a Wayland server-side decoration compositor, and display scales other than 1. Please reopen or file a new issue if anything misbehaves on another desktop or scale.
Activity
wmfeht commentedon Nov 22, 2026
From Strata (lgse/strata), a file manager on Rune that draws its own header: on Wayland the window menu is missing as well.
chrome::window_menu(window/chrome.rs:138-155at67d73a5f) is still Windows-only, so a right-click on a.window_drag()region opens nothing on Linux. winit's Waylandshow_window_menualready sendsxdg_toplevel.show_window_menu, which GNOME and KDE expect; Rune doesn't call it.One more piece would let a custom header match the desktop: the desktop's titlebar double-click action (
org.gnome.desktop.wm.preferences action-double-click-titlebar, also in the Settings portal), instead of always maximising (titlebar_double_click,window/chrome.rs:106-111at67d73a5f).opencodejr commentedon Nov 25, 2026
Thanks for the clear write-up. I checked, and the gap is real:
window_menuandhas_window_menuincrates/rune/src/window/chrome.rsonly work on Windows. On Linux they do nothing, so a right-click or Alt+Space on a custom titlebar opens no menu.show_window_menuis empty on X11. On Wayland it does sendxdg_toplevel.show_window_menu, but Rune never calls it, as @wmfeht points out.I'll treat this as a feature request in these parts:
_GTK_SHOW_WINDOW_MENU, but only when the window manager advertises it.show_window_menufor the same titlebar and keyboard paths.The Wayland state may need changes in winit. The desktop's titlebar double-click setting from the comment is a related follow-up.
opencodejr commentedon Nov 25, 2026
I've opened a PR for the window-menu half of this:
.window_drag()region, or Alt+Space that no handler takes, now calls winit'sshow_window_menu(xdg_toplevel.show_window_menu). That should also cover the Strata case @wmfeht described._GTK_SHOW_WINDOW_MENUitself, only when the window manager lists it in_NET_SUPPORTED. winit's X11show_window_menudoes nothing.The change hasn't been compiled or tested yet, so it needs a build and a try on a real desktop before merging. Reading the decoration mode, tiled edges and available actions isn't in this PR: it needs its own API with an explicit "unknown" value, and on Wayland it depends on winit exposing that state.
Fixed in #2196.
rock3r commentedon Nov 25, 2026
Thank you. We can test #2196 on real X11 and Wayland desktops and report the result here. We will do this on the merged code in
dev.rock3r commentedon Nov 25, 2026
Tested #2196 live: the window menu does not open from a custom titlebar on GNOME, on Wayland or on X11.
Setup: Rune
devat4f8a7d14,cargo run -p rune --example custom_titlebar, on Ubuntu 26.04 with GNOME Shell 50.1, scale 1. On X11 the test ran through XWayland, whose window manager lists_GTK_SHOW_WINDOW_MENUin_NET_SUPPORTED. Input came from Mutter's RemoteDesktop API, and screenshots came from its ScreenCast stream..window_drag()band, between the title text and the buttonsThe first row shows that input reaches the window. The build passes, and the 5
window_menuunit tests pass. The example reports chrome insets of 0 on both backends, and GNOME keeps its own decorations: server-side on X11 and client-side on Wayland. So the window shows two title bars, and the band may never act as a titlebar on Linux. Could you reopen this issue, or tell us which setup #2196 expects?opencodejr commentedon Nov 25, 2026
Thanks for testing this so carefully. You're right: #2196 doesn't open the menu on Linux. It isn't your setup.
Why:
secondary_region_down(crates/rune/src/runtime/input/titlebar.rs) only treats a right-press on a.window_drag()region as a titlebar press while the runtime has a caption. Only the Windows custom frame sets one (caption()inwindow/chrome.rsreturnsNoneelsewhere). On Linux the release never asks for the window menu, so the new Wayland (xdg_toplevel.show_window_menu) and X11 (_GTK_SHOW_WINDOW_MENU) code never runs. The unit tests only cover building the X11 message and the_NET_SUPPORTEDcheck, so they missed this. That's a gap in #2196.Setup: the two title bars and zero chrome insets are expected today. On Linux,
App::titlebarkeeps the native frame (see the README'sApp::titlebarentry), so that band never replaces the title bar. The setup #2196 was meant for is a borderless window (WindowSpec { borderless: true, .. }) whose header uses.window_drag()regions, like Strata's. The same caption check blocks that case too, so it won't work there yet either.This should be reopened. On Linux the check needs to depend on whether the window can show a window menu, not on the Windows caption. The decoration-mode, tiled-edge and window-action half of this issue was never done either.
rock3r commentedon Nov 25, 2026
When the caption check is fixed, we can test a borderless window (
WindowSpec { borderless: true, .. }) live on GNOME, on Wayland and on X11, and report here.opencodejr commentedon Nov 25, 2026
Thanks, a borderless window (
WindowSpec { borderless: true, .. }) is the right setup to test. Once a fix for the caption check lands, these are the checks that would tell us the most, on both Wayland and X11:.window_drag()region. GNOME's window menu should open at the pointer.For anything that fails, a note of which backend it was would be enough.
Hona commentedon Nov 25, 2026
The reactive window-manager state API and its X11 backend are now on
devin #2249 (0ade7deab).On
devnow (X11):Cx::decoration_mode() -> DecorationMode(Unknown/Server/Client), read from_NET_FRAME_EXTENTS(never inferred from missing actions oris_decorated()).Cx::tiled_edges() -> Option<TiledEdges>(Nonewhen unknown,Some(TiledEdges::NONE)when untiled), read from_GTK_EDGE_CONSTRAINTS(bits 0=top, 2=right, 4=bottom, 6=left; matching Chromium Linux, GTK4, and libadwaita).Cx::window_actions() -> WindowActions(window_menu,maximize,minimize,fullscreen,close, eachOption<bool>), read from per-window_NET_WM_ALLOWED_ACTIONSand root_NET_SUPPORTED(_GTK_SHOW_WINDOW_MENU).memoclosures) rebuild automatically on change; views that never read them do no extra work. Wayland, macOS, Windows, and web currently reportUnknown/None.cargo run -p rune --example custom_titlebaralso displays these three values live.What to try on X11 / XWayland (not run on a live desktop here — verified via unit tests, doctests, and Linux container / macOS / Windows / wasm32 builds):
tiled_edgesreportsSome(TiledEdges { top: true, right: false, bottom: true, left: true })on left half and{ top: true, right: true, bottom: true, left: false }on right half, andSome(TiledEdges::NONE)when untiled.cx.is_maximized()flips without falsely setting tiled edges when untiled.window_actions().maximizereportsSome(false)while other allowed actions staySome(true).WindowOptions { borderless: true, .. }): verifydecoration_mode()reportsServerwhen_NET_FRAME_EXTENTSis non-zero andClientwhen it is[0, 0, 0, 0](orUnknownif unset).Leaving this issue open for the remaining pieces: Wayland
xdg-decoration/xdg_toplevelconfigure state + X11PropertyNotifywake in the next PR, the Linux custom-titlebar window-menu repair, and live GNOME X11/Wayland confirmation.fix(linux): open the window manager's window menu on right-click of b…
rock3r commentedon Nov 25, 2026
Tested #2249 live on X11:
devat0ade7deab, on XWayland under GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1. A small app loggeddecoration_mode(),tiled_edges(),is_maximized()andwindow_actions()on every change. GNOME's shortcuts drove it through Mutter's RemoteDesktop API. Screenshots confirmed that each tile and maximize happened.decoration_mode()Unknownfor the first frame, thenServer✅Unknown❌ (expectedClient)Server✅NONE, though the window visibly tiled ❌leftis false ❌NONE❌rightis false ❌NONE✅NONE✅is_maximized()flips both ways, andtiled_edgesstaysNONE✅is_maximized()flips both ways, andtiled_edgesreports all four edges while maximized,NONEafter restorewindow_actions().maximizeSome(true)Some(true)Some(false)✅ (andfullscreenisSome(false))Summary:
Unknown.fix(linux): open the window manager's window menu on right-click of b…
fix(linux): open the window manager's window menu on right-click of b…
fix(linux): open the window manager's window menu on right-click of b…
Hona commentedon Nov 25, 2026
A fix for the Linux window-menu trigger is now on
devin #2271 (b16605c7b).What changed:
captioncheck that blocked right-clicks on bare.window_drag()regions on Linux (both borderless windows andApp::titlebar).xdg_toplevel.show_window_menunow fires on right-button press instead of release, whilewinitstill holds the button-press serial (calling it on release sent the release serial, which compositors checking the implicit-grab serial ignore). Touch long-press now also passes the touch position rather than(0, 0)._GTK_SHOW_WINDOW_MENUfires on right-button release (after the X server releaseswinit's implicit button-press grab) and reads_GTK_SHOW_WINDOW_MENUsupport from feat(window): expose reactive Cx decoration mode, tiled edges and window actions with X11 backend #2249's_NET_SUPPORTEDquery instead of querying a second time.About the two title bars in
custom_titlebar: that is expected today. On Linux,App::titlebarkeeps the native frame (see theApp::titlebar/WindowSpec::titlebarentry incrates/rune/README.md, which notes zeroCx::chrome_insets()where the native frame stays), while a custom.window_drag()header is intended for a borderless window (WindowSpec { borderless: true, .. }).What could not be verified here: we have no live Linux desktop (Wayland or X11 display server) in this run, so #2271 is verified by headless unit tests and Linux container compilation/clippy, not seen live on GNOME. Could you repeat your table on
devatb16605c7bon both Wayland and X11:WindowSpec { borderless: true, .. }) with a.window_drag()header (bare band right-click, button inside the band right-click, and menu actions like Move / Resize / Maximize / Close).cargo run -p rune --example custom_titlebaras it is (with GNOME's native frame kept).Leaving this issue open for live confirmation and the remaining Wayland decoration-mode / tiled-edges / window-actions work.
rock3r commentedon Nov 25, 2026
Retested #2271 live:
devatb16605c7b, GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1, on Wayland and on X11 (XWayland). Input came from Mutter's RemoteDesktop API. The table's results come from screenshots taken through its ScreenCast stream, and from the app's own log.1. A borderless window (
WindowOptions { borderless: true, .. }) with a 44 pt.window_drag()header band and a button in the band.is_maximized()becomes true ✅2.
cargo run -p rune --example custom_titlebar, unchanged, with GNOME's frame kept. A right-click on the bare part of the app's band opens GNOME's window menu, on Wayland and on X11 ✅.Not separated: we did not test press timing apart from release timing. Each click was a press and a release 80 ms apart, so this test does not show that Wayland opens the menu on press and X11 on release.
Thanks, this works now.
Hona commentedon Nov 25, 2026
Thanks for testing #2249 live and posting the table — that pinpointed all four X11 gaps right away. Both the X11 fixes and the Wayland backend are now on
devin #2283 (6bee31712), and the Linux custom-titlebar window-menu repair is also ondevin #2271 (b16605c7b).(Apps pinning
devneed to update their[patch.crates-io]winitrev to6bee31712or newer becausevendor/winit.patchwas updated.)What was wrong in each X11 cell (fixed in #2283)
NONE: Mutter'supdate_gtk_edge_constraints(src/x11/window-x11.c) writes_GTK_EDGE_CONSTRAINTSon the reparented frame parent (priv->frame->xwindow), not on the client window. Rune now falls back to the reparented parent frame when the client window has no_GTK_EDGE_CONSTRAINTS. (Note: when maximized, Mutter writes0x55— all four edges constrained — on both titled and borderless windows, matching GTK4 and Chromium, and0xAA/NONEon restore.)left/right: On Ubuntu 26.04,ubuntu-tiling-assistanthandles Super+Left/Right viaset_maximize_flags(VERTICAL)on a half-width frame instead ofmeta_window_tile, so Mutter writes onlyTOP_TILED | BOTTOM_TILED(0x99) plus_NET_WM_STATE_MAXIMIZED_VERT. Rune now refines_NET_WM_STATE_MAXIMIZED_VERT(withoutHORZ, and the horizontal twin) against_NET_WORKAREAintersected with the active monitor rect so flush left/right edges are reported without affecting floating vertically-maximized windows.decoration_mode()stayedUnknown: Mutter omits_NET_FRAME_EXTENTSon frameless windows (priv->frame == NULL). When_NET_FRAME_EXTENTSis absent, Rune now reportsDecorationMode::Clientif the app requested no native frame (borderless: true), an EWMH WM is managing the window, and it was not reparented into a WM frame (titled windows without_NET_FRAME_EXTENTSstayUnknown).Unknown→Servertiming: Frame 1 before Mutter finishes mapping and framing the window is genuinelyUnknownon X11; vendoredwinitnow wakes Rune onPropertyNotifyfor_NET_FRAME_EXTENTS,_NET_WM_STATE,_NET_WM_ALLOWED_ACTIONS, and_GTK_EDGE_CONSTRAINTSso the update arrives as soon as Mutter writes the property even without a resize or focus change (zero X11 IPC on ordinary redraws).Wayland backend (now on
devin #2283)Cx::decoration_mode()readsxdg-decoration/xdg_toplevelconfigure mode directly (Unknownbefore initial configure,ServerorClientafterwards).Cx::tiled_edges()readsxdg_toplevelTILED_*states onxdg_toplevelv2+ (Nonebelow v2 or before initial configure).Cx::window_actions()readsxdg_toplevel::wm_capabilities(window_menu,maximize,minimize,fullscreen;closestaysNone) onxdg_toplevelv5+ (Nonebelow v5 sosctk's defaultall()never leaks).sync_chrome_core. Layer-shell overlays are not toplevels and remainUnknown/None.cargo run -p rune --example custom_titlebarshows the livewm:readout. None of this has been run on a live Wayland or X11 desktop here (verified via cross-platform unit tests, doctests, wasm32/WebGL2, macOS, Windows, and Linux container builds only).Could you run three quick checks on
dev(6bee31712)?decoration_mode(), Super+Left, Super+Right, Super+Down, Super+Up/restore,window_actions()).decoration_mode()(client-side on GNOME; server-side on an SSD compositor if available)window_actions()on resizable vs. non-resizable windows.window_drag()region on both Wayland and X11, now repaired in fix(linux): open the window manager's window menu on right-click of bare window_drag regions #2271).Leaving #313 open until live GNOME Wayland and X11 results confirm everything.
rock3r commentedon Nov 25, 2026
Retested #2283 live:
devat6bee31712, GNOME Shell 50.1 (Mutter), Ubuntu 26.04, scale 1, Wayland and X11 (XWayland).decoration_mode(),tiled_edges(),is_maximized(),is_full_screen()andwindow_actions()on every change. Its window has a 44 pt.window_drag()band, and F callsTx::toggle_full_screen.1. X11: every gap from the last table is fixed.
decoration_mode()Server✅Client✅Unknownfor the first frame, thenServer✅NONE✅NONE✅is_maximized()flips; edgesNONEwhile maximized ✅is_full_screen()flips both ways ✅window_actions()Some(true)maximize: Some(false),fullscreen: Some(false)✅Two small things on X11:
decoration_mode() == Client, andmaximize: Some(false). Right after leaving full screen, one frame still reportsClientbefore it returns toServer.2. Wayland
decoration_mode()Client✅Client✅Client✅leftis false ❌rightis false ❌NONE✅NONE✅is_maximized()flips; all four edges while maximized ✅is_full_screen()flips both ways ✅window_actions()close: Noneon every window, while X11 givesSome(true)maximize: Some(true)❌ (expectedSome(false); the WM refused Super+Up)Screenshots confirm that both the keyboard and the drags tiled the window to the correct half. Only the side edge is missing from
tiled_edges().3. Window menu: unchanged, every check passes on both backends.
custom_titlebarwith GNOME's frame kept, a right-click on the app's band opens the menu.Hona commentedon Nov 25, 2026
Thanks again for the thorough Wayland and X11 tables — every X11 fix from #2283 held on live Mutter because of them. The follow-up fixes for the five remaining items are now on
devin #2293 (cb2f50056, with novendor/winit.patchchange).Cause and status for each of the five items
left/right— documented protocol limit:src/wayland/meta-wayland-xdg-shell.c(fill_states) emitsXDG_TOPLEVEL_STATE_TILED_*directly fromwindow->edge_constraints(and Wayland maximize already reported all four edges through the samesctk/winitpath, confirmingTILED_LEFT/TILED_RIGHTare not dropped).ubuntu-tiling-assistant(tilingWindowManager.js) handles half-tiles by callingwindow.set_maximize_flags(VERTICAL)while skippingoverride_constraints, so Mutter only sets top and bottom constraints and never sendsTILED_LEFTorTILED_RIGHT.gdk/wayland/gdktoplevel-wayland.c) and Chromium (ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc) pass through the compositor'sTILED_*states verbatim with no guess. Rune documents this limit onCx::tiled_edges().window_actions().maximizeon a non-resizable window — fixed:xdg_toplevel.wm_capabilitiesunconditionally before initial configure (compositor support, not per-window resizability).WM_CAPABILITIES_MAXIMIZEwithwindow.is_resizable() && window.enabled_buttons().contains(WindowButtons::MAXIMIZE)(matching GTK4'sgtk/gtkwindowcontrols.c), so non-resizable Wayland windows reportmaximize: Some(false)whilefullscreenremainsSome(true)where Mutter allows it.window_actions().close— fixed:xdg-shellhas no close capability because a Wayland client can always close its own toplevel. Following GTK4'sdeletableproperty (gtk/gtkwindowcontrols.c), Rune now reportsclose: Some(true)once a Wayland toplevel is configured (andSome(false)only if the close button is disabled;Nonepre-configure or on overlays), matching X11 so one title bar works on both backends.decoration_mode()in full screen and 1 frame after leaving — fixed:mutter-x11-framescollapses frame borders to[0, 0, 0, 0], and on exit_NET_WM_STATE_FULLSCREENclears before_NET_FRAME_EXTENTSis asynchronously restored to[0, 0, 37, 0].DecorationModeduring full screen and across the 1-frame restore window while the titled window remains reparented in its WM frame (keepingwindow_actions().maximize == Some(false)in full screen as Mutter reports).tiled_edges()while maximized — fixed:_GTK_EDGE_CONSTRAINTSfrom the reparented parent frame (priv->frame->xwindow) whenhas_wm_frameis true (preferring it over any stale pre-frame client property) and reportsSome(TiledEdges::ALL)when_NET_WM_STATEhas bothMAXIMIZED_HORZandMAXIMIZED_VERT, matching GTK4, Mutter'supdate_edge_constraints, Chromium'sX11Window::GetTiledState, borderless X11, and Wayland.(No live GNOME Wayland or X11 desktop was run here — verified via cross-platform unit tests, doctests, wasm32/WebGL2 + strict lints, Windows, macOS, and Linux container builds only.)
Short repeat on
dev(cb2f50056)WAYLAND_DEBUG=1showingxdg_toplevel@*.configure'sstatesarray for a left tile (with Ubuntu Tiling Assistant on, and if convenient, off), that will confirm item 1 completely.window_actions(): confirmclose: Some(true)on every window, and on the non-resizable windowmaximize: Some(false)withfullscreen: Some(true).decoration_mode()staysServerthroughout full screen and immediately after leaving (no 1-frameClient), withmaximize: Some(false)while full screen.NONEafter restore.Leaving #313 open until those confirm live.
rock3r commentedon Nov 25, 2026
Repeated on
devatcb2f50056: GNOME Shell 50.1, Ubuntu 26.04, scale 1. The setup is the same as in the last table. Every check passes.1. Wayland left tile,
WAYLAND_DEBUG=1. The debug log prints the state array's size, not its values.[email protected], Ubuntu's default):xdg_toplevel#34.configure(926, 1048, array[12]), which is 3 states;tiled_edges(): top and bottom.xdg_toplevel#34.configure(927, 1048, array[16]), which is 4 states;tiled_edges(): top, bottom and left ✅.2. Wayland
window_actions().close: Some(true)on the titled, borderless and non-resizable windows ✅.maximize: Some(false)✅ andfullscreen: Some(true)✅.3. X11 titled full screen (F twice).
decoration_mode()staysServerthroughout, with noClientframe on entering or leaving ✅.maximize: Some(false)while in full screen, andSome(true)after ✅.4. Maximize with Super+Up, then restore with Super+Down. X11 titled, X11 borderless, Wayland titled and Wayland borderless all report all four edges and
is_maximized()while maximized, thenNONEafter the restore ✅.Thanks, #313 looks complete from our side.
Hona commentedon Nov 25, 2026
Everything requested in this issue is now on current
dev:Cx::decoration_mode(),Cx::tiled_edges(),Cx::window_actions(), and the Linux window menu on bare.window_drag()regions for both X11 (_GTK_SHOW_WINDOW_MENU) and Wayland (xdg_toplevel.show_window_menu).0ade7deab): reactiveCxwindow-manager state API and initial X11 backendb16605c7b): Linux window-menu trigger on X11 and Wayland6bee31712): Wayland backend, X11PropertyNotifywakes, and X11 tiling/borderless fixescb2f50056): Waylandwindow_actionsand X11 fullscreen/maximized state alignmentcargo run -p rune --example custom_titlebarshows the live readout. Apps pinningdevshould update their[patch.crates-io]winitrev to6bee31712or newer.All of these were confirmed live on a GNOME desktop on both X11 and Wayland by a reporter in this thread—thank you for three rounds of tables in one day, which got both backends right. One documented limit: on Wayland, Ubuntu's default tiling assistant extension sends only top and bottom states on half tiles, so Rune reports top and bottom verbatim; with the extension off, the compositor sends the side edge too and Rune reports it.
Not yet tested live: other desktops and window managers (KDE, Sway, Hyprland, or a tiling X11 WM), a Wayland server-side decoration compositor, and display scales other than 1. Please reopen or file a new issue if anything misbehaves on another desktop or scale.