Repository navigation
feat(window): add opt-in ResizeSync (Auto, On, Off) builder on App and WindowSpec - #2319
Merged
Merged
Conversation
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 #2113
Adds the strictly additive per-window
ResizeSyncpolicy (Auto,On,Off) onAppandWindowSpecwhile keeping the Windows drag-only synchronized resize path off by default (ResizeSync::Autoresolves to off today).Public API
#[non_exhaustive] pub enum ResizeSync { #[default] Auto, On, Off }incrates/rune/src/window/resize_sync.rs, re-exported fromwindow.rsandlib.rs(mirrorsCpuFirst).App::resize_sync(self, mode: ResizeSync) -> Selfand forwardedWindowSpec::resize_sync(self, mode: ResizeSync) -> Self(no pub field on literal structs, noWindowsWindowOptionsknob, noCxreader).crates/rune/src/window/win32/resize_sync.rstoDragResizeSyncso it does not shadowrune::ResizeSync.Resolution & kill switch
OnceLock<bool>with per-window resolution onHost(Host::resize_sync_enabled), so multi-window apps can opt individual windows in or out independently.RUNE_RESIZE_SYNCoverrides every window without a rebuild:1,true,yes,on(ASCII case-insensitive) →ResizeSync::On0,false,no,off→ResizeSync::Off(unconditional kill switch overResizeSync::On)auto→ResizeSync::Auto(off today; may promote to on in a later release once more GPU/OS configurations are verified)WindowBackdropandEl::system_material),WGPU_DX12_PRESENTATION_SYSTEM=hwnd, software/WARP adapters, non-8-bit/HDR formats, and CPU/handover/rebinding states.Autotoday orOff), zero D3D11 devices, shared textures, second swap chains, or extraHandoverobjects are created.Docs, example & changelog
no_runrustdoc onResizeSync,App::resize_sync, andWindowSpec::resize_syncdocumenting the path, hybrid-GPU bitblt and post-drag D3D11 device (~15–40 MiB) costs, and the accepted ~5% occasional late-step limit at 239 Hz (citing Microsoft Learn For best performance, use DXGI flip model,DXGI_SWAP_EFFECT,DXGI_SCALING,WM_NCCALCSIZE, andIDCompositionTarget::SetRoot; undocumented interfaces declined).crates/rune/README.mdbesideCpuFirst.--resize-sync(on/off/auto) CLI flag toexamples/settings/src/main.rs(cargo run --release -p settings -- --resize-sync).changelog/unreleased/2026-11-26-public-resize-sync-switch.md.