1
0
Fork 0
forked from wry/wry

Add animation style toggle

This commit is contained in:
atagen 2026-05-27 22:52:06 +10:00
parent 02222d5189
commit e7f9a5cb09
15 changed files with 238 additions and 20 deletions

View file

@ -6,11 +6,11 @@ be handled deliberately.
## Accepted Decisions
- The first landed slice is linear interpolation only, disabled by default.
- The first landed slice is plain interpolation only, disabled by default.
- Animation is presentation-only. Logical layout, input hit testing, focus, and
Wayland configure state use final geometry immediately.
- Pointer drag and resize initiated by the mouse or tablet do not animate.
- Linear animations restart only for windows whose destination changes. Other
- Plain animations restart only for windows whose destination changes. Other
in-flight windows keep their existing timelines.
- Spawn-in uses scale and position for newly mapped tiled and floating app
windows. Layer-shell, overlay, override-redirect, and fullscreen surfaces do
@ -19,7 +19,7 @@ be handled deliberately.
destroy.
- Command-driven tile-to-float and float-to-tile transitions may animate.
Protocol drag/drop paths do not.
- The no-overlap multiphase system is a separate phase after the linear path is
- The no-overlap multiphase system is a separate phase after the plain path is
working and testable.
- Content freezing will use retained per-surface texture references, not a full
offscreen snapshot as the default design.
@ -34,7 +34,7 @@ be handled deliberately.
below roughly one quarter of the relevant full size. The implementation may
enforce a conservative sanity minimum, and pathological cases may fall back.
- If the no-overlap planner cannot produce a legal sequence, only the affected
group should fall back to linear animation. This is expected to be rare for
group should fall back to plain animation. This is expected to be rare for
valid tiling layouts.
- When entering mono mode, the active child should animate to the mono geometry.
Inactive siblings may snap invisible. Floats may overlap normally and do not
@ -285,6 +285,7 @@ Phase 1 should expose a disabled-by-default setting for:
- enabled/disabled
- duration
- style: `plain` or `multiphase`
- curve preset or cubic bezier
Initial TOML shape:
@ -293,6 +294,7 @@ Initial TOML shape:
[animations]
enabled = false
duration-ms = 160
style = "multiphase"
curve = "ease-out"
# or:
curve = [0.25, 0.1, 0.25, 1.0]

View file

@ -24,9 +24,24 @@ Relevant internal config hooks:
- `SetAnimationsEnabled`
- `SetAnimationDurationMs`
- `SetAnimationStyle`
- `SetAnimationCurve`
- `SetAnimationCubicBezier`
TOML example:
```toml
[animations]
enabled = true
duration-ms = 600
style = "multiphase"
curve = "ease-out"
```
Set `style = "plain"` to force ordinary one-step movement interpolation while
keeping the configured curve. `curve = "linear"` only changes easing; it does
not select the plain animation style.
Current curve IDs in code:
- `0`: linear
@ -37,19 +52,20 @@ Current curve IDs in code:
## Enabling Multiphase Tests
There is currently no separate user-facing multiphase toggle. To exercise the
multiphase planner:
To exercise the multiphase planner:
1. Enable animations with `SetAnimationsEnabled`.
2. Set a slow duration with `SetAnimationDurationMs`, around `400-700ms`.
3. Use tiled layout commands that are wired through `State::with_layout_animations`.
4. Use layouts where at least two tiled windows change geometry in the same
3. Select `style = "multiphase"` in TOML, or call `SetAnimationStyle` with
`AnimationStyle::MULTIPHASE`.
4. Use tiled layout commands that are wired through `State::with_layout_animations`.
5. Use layouts where at least two tiled windows change geometry in the same
container layout batch.
The compositor then attempts multiphase planning automatically when the batched
layout pass completes. If the planner proves a legal no-overlap sequence, that
group uses phased animation. If it cannot prove one, only that motion group falls
back to ordinary linear animation.
back to ordinary plain animation.
Good command families for multiphase testing:
@ -64,7 +80,7 @@ Good command families for multiphase testing:
These paths should not be used as evidence of multiphase behavior:
- tile-to-float and float-to-tile, which deliberately use linear animation
- tile-to-float and float-to-tile, which deliberately use plain animation
- command-driven floating move/resize, which may animate but can overlap
- pointer or tablet drag/resize, which should not animate
- spawn-in and spawn-out, which are single-phase and use the configured curve
@ -73,7 +89,7 @@ These paths should not be used as evidence of multiphase behavior:
Useful debug signal:
- `falling back to linear layout animation for group ...` means the group entered
- `falling back to plain layout animation for group ...` means the group entered
the multiphase gate but the planner rejected it. That is acceptable for
unsupported patterns, but unexpected for the supported swap/extraction cases
below.