Repository navigation
fix(linux): align Wayland window_actions and X11 fullscreen/maximized WM state with GTK4 - #2293
Merged
Merged
Conversation
… WM state with GTK4
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #313
Addresses all five items from live testing #2283 on GNOME Shell 50.1 (Ubuntu 26.04, Wayland and XWayland). No
vendor/winit.patchchange is needed.Changes
crates/rune/src/runtime/cx.rs,crates/rune/README.md,crates/rune/src/window/chrome/linux_wm_state_tests.rs):GNOME/mutter(src/wayland/meta-wayland-xdg-shell.c,fill_states) that Mutter sendsXDG_TOPLEVEL_STATE_TILED_*directly fromwindow->edge_constraints, and inubuntu/Tiling-Assistant(tilingWindowManager.js) that Ubuntu's default extension half-tiles viawindow.set_maximize_flags(VERTICAL)while skippingoverride_constraints, so Mutter only sendsTILED_TOP | TILED_BOTTOM(confirmed by Wayland maximize already reporting all four edges through the samesctk/winitpath).gdk/wayland/gdktoplevel-wayland.c) and Chromium (ui/ozone/platform/wayland/host/wayland_window_unittest.cc) pass through the compositor'sTILED_*states verbatim with zero position guessing (Wayland hides global window position). Documented this limit inCx::tiled_edges()andcrates/rune/README.md.window_actions().maximizeon non-resizable windows (crates/rune/src/window/chrome/linux_wm_state.rs):xdg_toplevel.wm_capabilitiesreports compositor capabilities, not per-window resizability (Mutter sends all four unconditionally before initial configure).WM_CAPABILITIES_MAXIMIZEwithwindow.is_resizable() && window.enabled_buttons().contains(WindowButtons::MAXIMIZE), matching GTK4 (gtk/gtkwindowcontrols.c,update_window_buttons), so non-resizable Wayland windows reportmaximize: Some(false)(agreeing with X11 and GNOME refusing Super+Up) while keepingfullscreen: Some(true)where the compositor allows it.window_actions().close(crates/rune/src/window/chrome/linux_wm_state.rs,crates/rune/src/window/wm_state.rs):Some(window.enabled_buttons().contains(WindowButtons::CLOSE))(Some(true)on normal configured toplevels,Nonebefore initial configure or for overlays), matching GTK4'sdeletableproperty (gtk/gtkwindowcontrols.c) and X11 so one title bar works identically on both backends. Documented whatNonemeans for eachWindowActionsfield.decoration_mode()in and right after full screen (crates/rune/src/platform/x11/wm_state.rs,crates/rune/src/window/chrome.rs,crates/rune/src/runtime/system_settings.rs):mutter-x11-framescollapses frame borders to[0, 0, 0, 0], and right after leaving full screen_NET_WM_STATE_FULLSCREENclears before_NET_FRAME_EXTENTSis asynchronously restored to[0, 0, 37, 0].decode_frame_extentsnow preserves the prior confirmed non-fullscreenDecorationModeduring full screen and across the 1-frame asynchronous restore 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 (crates/rune/src/platform/x11/wm_state.rs):_GTK_EDGE_CONSTRAINTSfrom the reparented parent frame (priv->frame->xwindow) whenhas_wm_frameis true and prefers 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.Verification
crates/rune/src/window/chrome/linux_wm_state_tests.rsandcrates/rune/src/platform/x11/wm_state_tests.rs.cargo check-wasm,cargo check-webgl,cargo lint-wasm,cargo lint-webgl,cargo clippy), macOS (46 unit tests coveringwindow::chrome::,window::wm_state::,platform::x11::wm_state::,runtime::input::titlebar::, pluscheckandclippy), and Linux container (check -p rune -p rune-kit --examples --benches --testsandclippy -p rune --lib --bins --tests --example custom_titlebar).runelib test linking in the container hits OOM).