Skip to content

Windows: animations freeze while a window move or resize is held still #2908

Done

Description

@zAcherttp

What happens: while the pointer is pressed on a window's title bar or resize border, animations stop until the pointer moves. In kit-gallery, open the motion/focus dialog (spinner and loader), then press and hold the title bar or a border without moving: both animations freeze, and they continue when you release or start moving.

It happens with RUNE_RESIZE_SYNC=0 as well as =1, so it isn't specific to the drag resize path. With resize sync on, the drag timer from #2753 keeps animations running once the first size step has started the drag, but not between the press and that first step, and not at all during a move.

Why: pressing the title bar or a border starts Windows' modal size-move loop (WM_ENTERSIZEMOVE), which runs until the button is released. Inside it, Rune only draws when the window procedure gets a size step or a paint; its animation wake-ups from the event loop don't run. A held move sends no size steps at all.

Suggested fix: the modal loop still dispatches WM_TIMER, so a timer like the one in #2753 can cover every window and both cases. In the dpi_drag subclass, arm it at WM_ENTERSIZEMOVE whenever something is animating, invalidate the window on each tick so winit delivers RedrawRequested, and kill it at WM_EXITSIZEMOVE or when nothing is animating any more.

Steps to reproduce

  1. cargo run --release -p kit-gallery
  2. Open the motion/focus dialog (the one with the spinner and loader).
  3. Press and hold the title bar, or a resize border, without moving.

Environment: dev at 3592b1e3, Windows 11 (build 26320), RTX 4070, DX12, 239 Hz.

Activity

  1. Hona commented on Nov 30, 2026

    @Hona
    Member

    Fixed in PR #2918 (merged to dev in 1bffd17f6).

    Design decision: Replaced the ResizeSync-only drag timer in platform::win32::dpi_drag with a demand-only modal size-move state machine (ModalTickState / step_modal_tick) paired with window::win32::modal_tick (compute_modal_demand / Host::sync_modal_tick) for every Windows app window. Outside WM_ENTERSIZEMOVE..WM_EXITSIZEMOVE, the host records redraw demand in memory with zero Win32 calls; at WM_ENTERSIZEMOVE, the subclass arms a WM_TIMER immediately when the window has continuous motion (such as Loader), a pending redraw, a stepped Cycle loop (such as Spinner) or scheduled timer, or ResizeSync DComp priming, invalidating on each tick so winit delivers RedrawRequested and killing the timer immediately when idle, on WM_EXITSIZEMOVE, or on WM_NCDESTROY.

    Verified locally:

    • cargo check -p rune --lib and cargo check -p rune --lib --target wasm32-unknown-unknown
    • cargo test -p rune --lib dpi_drag (5 passed)
    • cargo test -p rune --lib modal_tick (6 passed)
    • cargo test -p rune --lib resize_sync (32 passed)
    • scripts/file-size.sh

    Not run locally: live interactive Windows title bar / resize border hold visual test in kit-gallery. Please reopen if anything still pauses or misbehaves on hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions