Skip to content

fix(linux): open the window manager's window menu on right-click of bare window_drag regions - #2271

Merged
Hona merged 1 commit into
devfrom
fix/313-linux-window-menu
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
fix/313-linux-window-menu

Conversation

@Hona

@Hona Hona commented Nov 25, 2026

Copy link
Copy Markdown
Member

Refs #313

Root cause

Protocol fixes found in #2196

flowchart LR
    A[Right press on bare .window_drag] --> B{WindowMenuTrigger}
    B -->|OnPress: Wayland| C[Request::Menu on Pressed -> xdg_toplevel.show_window_menu with press serial]
    B -->|OnRelease: Windows, X11| D[TitlebarPress::SecondaryOnRegion -> Request::Menu on Released]
    B -->|None: macOS, unsupported X11, Windows w/o caption| E[No menu]
Loading
  • Wayland press serial (xdg_toplevel.show_window_menu): xdg-shell requires the button-press serial, and winit/smithay-client-toolkit overwrites latest_button_serial() on button release. Calling show_window_menu on MouseInput::Released sent the release serial (ignored by Mutter < 50, cosmic-comp, and wlroots). Wayland now triggers WindowMenuTrigger::OnPress and window/host/events.rs drains take_window_menu() on MouseInput::Pressed, matching GTK4 (GtkWindowHandle), Chromium (WindowEventFilterLinux), sctk-adwaita, and GLFW.
  • X11 implicit pointer grab (_GTK_SHOW_WINDOW_MENU): Rune sends the client message on its separate x11rb query connection (which cannot UngrabPointer winit's connection), so X11 uses WindowMenuTrigger::OnRelease after the X server releases winit's implicit button grab. platform/x11/window_menu.rs also short-circuits menu_atom when _GTK_SHOW_WINDOW_MENU is uninterned (atom == 0) and guards translate_coordinates with same_screen.
  • Single _NET_SUPPORTED read via feat(window): expose reactive Cx decoration mode, tiled edges and window actions with X11 backend #2249: sync_wm_state_core (crates/rune/src/window/chrome.rs) sets the Linux WindowMenuTrigger from platform::x11::wm_state::read's actions.window_menu instead of querying _NET_SUPPORTED a second time, and honours Some(false) once Wayland wm_capabilities lands.
  • Wayland touch long-press position: Host::shell (crates/rune/src/window/host/lifecycle.rs) now passes rt.pointer() (scaled by rt.zoom()) for WindowMenu::Pointer instead of None (which fell back to (0, 0) on Wayland).
  • Checked with fix(titlebar): defer Linux mouse window drags past 8 pt so Wayland and X11 titlebar double-clicks work #2252 (TitlebarPress::Holding): Event::SecondaryDown { trigger } preserves fix(titlebar): defer Linux mouse window drags past 8 pt so Wayland and X11 titlebar double-clicks work #2252's cancellation of Holding on secondary press (preventing deferred drags after a right-click) and is covered together with fix(titlebar): defer Linux mouse window drags past 8 pt so Wayland and X11 titlebar double-clicks work #2252 for right-press while left-press is held, right-press after left-click within double-click time, and stray/misplaced right-release while left-press is held.

What was verified and what was not

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.

1 participant