Repository navigation
feat(window): expose reactive Cx decoration mode, tiled edges and window actions with X11 backend - #2249
Merged
Conversation
…dow actions with X11 backend
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
Exposes reactive, tri-state window-manager state on
Cx— confirmed decoration mode, per-edge tiled state, and allowed window actions — with an X11 backend and zerovendor/winitchanges (Wayland configure getters and X11PropertyNotifywake follow separately).API
#[non_exhaustive]types (crates/rune/src/window/wm_state.rs, re-exported fromrune):DecorationMode(Unknown/Server/Client),TiledEdges(top,right,bottom,left,NONE,ALL,new,any,is_empty),WindowActions(window_menu,maximize,minimize,fullscreen,close, eachOption<bool>), andWindowManagerState.Cx& headless API (runtime/cx.rs,runtime/api.rs,runtime/commit/measure.rs):Cx::decoration_mode(),Cx::tiled_edges(),Cx::window_actions(), andRuntime::set_window_manager_state(WindowManagerState). Packs 17 bits into unused bits8..=24ofchrome_bits()[4](leaving bits3..=7clear forWindowBackdrop) somemoclosures rebuild automatically with zero key growth. Tracks whether the committed view read any of the three accessors so apps that never read them do zero extra view builds or redraws when WM state changes.Cx::clear_chromeresets the state to default unknown for staged playground subviews.crates/rune/src/platform/x11/wm_state.rs,window/chrome.rs,window/host/events.rs): pipelinedx11rbquery onsync_chrome_core(create, resize, scale change, focus, un-occlusion) and X11WindowEvent::Moved, with zero X11 round trips on ordinary redraws:_NET_FRAME_EXTENTS(CARDINAL[4]): any> 0→Server, all0→Client, absent or length!= 4→Unknown(never inferred from missing actions oris_decorated())._GTK_EDGE_CONSTRAINTS(CARDINAL[1]): bit 0=top, bit 2=right, bit 4=bottom, bit 6=left (ignoring resizable bits 1/3/5/7);Some(TiledEdges::NONE)when absent while advertised in_NET_SUPPORTED,Noneotherwise (never guessed from_NET_WM_STATE_MAXIMIZED_VERT)._NET_WM_ALLOWED_ACTIONS:minimize,maximize(_NET_WM_ACTION_MAXIMIZE_HORZ && _NET_WM_ACTION_MAXIMIZE_VERT),fullscreen,close;Nonewhen absent._NET_SUPPORTED:window_menu(_GTK_SHOW_WINDOW_MENU);Nonewhen_NET_SUPPORTEDis absent.DecorationMode::Unknown,tiled_edges: None, and allWindowActionsasNone.crates/rune/examples/custom_titlebar.rsprints live decoration mode, tiled edges, and allowed actions.Outside references
ui/ozone/platform/x11,ui/ozone/platform/wayland/host/wayland_window.hWindowTiledEdges,ui/linux/window_frame_provider.h)gdk/x11/gdksurface-x11.c_GTK_EDGE_CONSTRAINTSbitmask: bits 0/2/4/6 tiled, bits 1/3/5/7 resizable) and libadwaita (.tiled-*classes)_NET_FRAME_EXTENTS,_NET_WM_ALLOWED_ACTIONS,_NET_SUPPORTED)Verification
Runtimereactivity / zero-extra-work /clear_chrometests on Windows, macOS, and Linux container.cargo test -p rune --doc),cargo check -p rune -p rune-kit --examples --benches --testson Windows, macOS, and Linux,cargo check-wasmandcargo check-webgl, andcargo clippyon Windows, macOS, and Linux.