Repository navigation
feat(linux): wire Wayland WM state, X11 PropertyNotify wake, and Mutter/Ubuntu X11 tiling & borderless fixes - #2283
Merged
Conversation
…er/Ubuntu X11 tiling & borderless fixes
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This was referenced Nov 25, 2026
Merged
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
Wires the Wayland backend (
xdg-decoration+xdg_toplevelconfigure state) and X11PropertyNotifywake through vendoredwinit, and fixes all four X11 issues reported from live testing #2249 on GNOME Shell 50.1 (Ubuntu 26.04 / XWayland). Shipped together in one PR sovendor/winit.patchonly changes once.Wayland backend +
vendor/winit.patch(+220 lines)WindowExtWayland::wayland_wm_state(&self) -> Option<(bool, Option<[bool; 4]>, Option<u16>)>(vendor/winit/src/platform/wayland.rs,wayland/window/mod.rs,wayland/window/state.rs):Nonebefore the initial configure (allUnknown/None) and on X11.configure.decoration_modedirectly (ServervsClient, never inferred from capabilities).tiled_edgesonxdg_toplevel.version() >= 2andwm_capabilitiesonxdg_toplevel.version() >= 5sosctk's defaultWindowManagerCapabilities::all()never leaks as known on older compositors.WindowState::configurewhendecoration_modeorcapabilitieschange without a size change, syncing chrome without wasting frames for views that never read WM state.crates/rune/src/window/chrome/linux_wm_state.rs): decodesWindowManagerCapabilities(WINDOW_MENU,MAXIMIZE,FULLSCREEN,MINIMIZE;closestaysNone) and tiled edges, matching Chromium (ui/ozone/platform/wayland/host/wayland_window.h) and GTK4 (GdkToplevelCapabilities).xdg_toplevelsurfaces; never callsync_chrome_coreand remainDecorationMode::Unknown,tiled_edges: None, and allWindowActionsNone.X11
PropertyNotifywake + live GNOME Shell 50.1 / Mutter fixesWindowExtX11::take_wm_state_changed(&self) -> bool(vendor/winit/src/platform/x11.rs,x11/atoms.rs,x11/window.rs,x11/event_processor.rs,crates/rune/src/window/host/events.rs): sets a per-windowAtomicBooland emitsRedrawRequestedwhenPropertyNotifyfires on_NET_WM_STATE,_NET_WM_ALLOWED_ACTIONS,_GTK_EDGE_CONSTRAINTS, or_NET_FRAME_EXTENTS. Ordinary redraws only check the atomic (zero X11 IPC); pre-mapUnknowntransitions toServer/Clientas soon as Mutter writes properties even without a resize or focus change.NONE(crates/rune/src/platform/x11/wm_state.rs): Mutter'supdate_gtk_edge_constraints(src/x11/window-x11.c) writes_GTK_EDGE_CONSTRAINTSonpriv->frame->xwindow(the reparented frame parent), not the client window. Rune now queriesquery_treeand reads_GTK_EDGE_CONSTRAINTSfrom the reparented parent frame when absent on the client window.left/right: Ubuntu'subuntu-tiling-assistantintercepts Super+Left/Right and callswindow.set_maximize_flags(VERTICAL)on a half-width frame instead ofmeta_window_tile, so Mutter writes_GTK_EDGE_CONSTRAINTS = 0x99(TOP_TILED | BOTTOM_TILEDonly) plus_NET_WM_STATE_MAXIMIZED_VERT. Rune now checks_NET_WM_STATE_MAXIMIZED_VERT && !_NET_WM_STATE_MAXIMIZED_HORZ(and the horizontal twin) against the monitor's_NET_WORKAREA(intersected with the active monitor rect, matching GTK4'sgdk_x11_screen_get_work_area) to recover the flush side edge without affecting floating vertically-maximized windows.decoration_mode()stayedUnknown: Mutter'supdate_net_frame_extentsonly writes_NET_FRAME_EXTENTSwhenpriv->frame != NULL. When_NET_FRAME_EXTENTSis absent, Rune now reportsDecorationMode::Clientonly when the app explicitly requested no native frame (!window.is_decorated()), the window is managed by an EWMH WM (_NET_WM_STATEor_NET_WM_ALLOWED_ACTIONSpresent), and it was not reparented into a WM frame (parent == root). Titled windows without_NET_FRAME_EXTENTSremainUnknown.Verification
vendor/winit.patchapplies cleanly with zero warnings to a fresh unpack ofwinit-0.30.13and reproducesvendor/winitidentically.linux_wm_state_tests.rs,wm_state_tests.rs,x11/wm_state_tests.rscovering exact Mutter bitmasks0xAA/0x55/0x59/0x95/0x99, reparented frame fallback, Ubuntu half-tile work-area edges, Wayland v1/v2..4/v5 gating, and headless reactivity) passed on Windows and macOS (30 passed).cargo check -p rune -p rune-kit --examples --benches --tests(Windows, macOS, Linux container),cargo clippy -p rune --lib --bins --tests --example custom_titlebar(Windows, macOS, Linux container),cargo check-wasm, andcargo check-webglall passed.runelib test binary inside the Linux container hit OOM SIGKILL; Linuxcheck --examples --benches --testsandclippy --testspassed).