Variables | |
| constexpr int | MinAnimationDurationMs = 50 |
| Minimum animation duration in milliseconds. | |
| constexpr int | MaxAnimationDurationMs = 2000 |
| Maximum animation duration in milliseconds. | |
| constexpr int | DefaultAnimationDurationMs = 150 |
| Default animation duration in milliseconds, used as the fallback at startup before settings are loaded from the daemon. | |
| constexpr int | MinAnimationStaggerIntervalMs = 10 |
| Minimum stagger interval between sequenced animations in milliseconds. | |
| constexpr int | MaxAnimationStaggerIntervalMs = 200 |
| Maximum stagger interval between sequenced animations in milliseconds. | |
| constexpr int | DefaultAnimationStaggerIntervalMs = 40 |
| Shipped stagger interval, the twin of DefaultAnimationDurationMs and there for the same reason: a consumer that caches the setting needs something to hold BEFORE the first reply lands, and an inline literal there drifts from the real default silently. | |
| constexpr int | SequenceModeAllAtOnce = 0 |
| Batch sequencing mode: 0 applies every window at once, 1 cascades them in zone order. | |
| constexpr int | SequenceModeCascade = 1 |
| constexpr int | DefaultAnimationSequenceMode = SequenceModeCascade |
| constexpr float | MaxShaderTimeDeltaSeconds = 0.1f |
| Hard ceiling on a per-frame time delta handed to a shader or to a physics integrator, in seconds. | |
| constexpr double | MinCurveProgress = -1.0 |
| Overshoot envelope for a curve's OUTPUT. | |
| constexpr double | MaxCurveProgress = 2.0 |
|
constexpr |
Default animation duration in milliseconds, used as the fallback at startup before settings are loaded from the daemon.
150 ms is short enough to feel snappy on legitimate rapid window churn but long enough that a user with a fresh install sees the transition rather than what looks like a hard cut. MUST sit within [MinAnimationDurationMs, MaxAnimationDurationMs] so an unconditional init through this constant is structurally safe — settings reload further refines it.
|
constexpr |
|
constexpr |
Shipped stagger interval, the twin of DefaultAnimationDurationMs and there for the same reason: a consumer that caches the setting needs something to hold BEFORE the first reply lands, and an inline literal there drifts from the real default silently.
The daemon's ConfigDefaults::animationStaggerInterval() resolves to this value.
|
constexpr |
Maximum animation duration in milliseconds.
Two seconds covers every reasonable use case (deliberate, drawn-out OSD reveals; slow-motion debugging) without letting a misconfigured tree freeze a popup for an unreasonable interval.
|
constexpr |
Maximum stagger interval between sequenced animations in milliseconds.
200 ms × N items is enough to feel deliberate without making large lists glacial.
|
constexpr |
|
constexpr |
Hard ceiling on a per-frame time delta handed to a shader or to a physics integrator, in seconds.
A sleep/resume hiccup, GC stall, or scheduler glitch must not blast a multi-second jump into a consumer that integrates the delta — shaders that advance state from iTimeDelta (sparkle drift, particle motion, noise advance), and spring curves — whose step() is an EXACT exponential integrator and is stable at any dt, so the cap bounds how far a stall JUMPS rather than whether the integrator survives it. 100 ms is generous: at the cap a single tick is 6 frames of motion at 60 Hz, beyond which the effect "skips" rather than blurring through unrealistic motion.
Every WALL-CLOCK delta producer clamps against this (keep in sync when adding one):
AnimatedValue::advance (AnimatedValue.h) — this library's own integrator, and the one every spring-curve animation runs on,overlayservice/shader.cpp),SurfaceAnimator's shader delta (surfaceanimator_tick.cpp),iTimeDelta uniform (plasmazoneseffect/paint_shader_window.cpp),ShaderInternal::easeProgress (plasmazoneseffect/shader_internal.h), the SINGLE clamp for the spring integrator's dt on BOTH compositor paint paths — the per-window transition and the desktop switch, which share it. Neither paint_pipeline.cpp nor desktoptransitionmanager.cpp clamps the integrator dt itself; they route through this helper. The desktop switch uploads no iTimeDelta uniform. A synthetic fixed step (tools/shader-render renders at 1/fps) cannot spike and needs no clamp.NOT clamped, and deliberately out of this library's reach: PhosphorRendering::ShaderEffect::onPlayingTick (libs/phosphor-rendering/src/shadereffect.cpp) pushes a raw wall-clock delta into a QML-hosted shader. phosphor-rendering does not link phosphor-animation, so wiring it up means adding that dependency — a layering call, not a drive-by. It self-mitigates a re-show (it rebases the clock while hidden) but not a stall while visible.
|
constexpr |
Minimum animation duration in milliseconds.
Below ~50 ms the transition is so brief the user perceives it as a snap.
|
constexpr |
Minimum stagger interval between sequenced animations in milliseconds.
Below 10 ms the staggering blurs into a single simultaneous burst.
|
constexpr |
Overshoot envelope for a curve's OUTPUT.
A curve is free to leave [0, 1] — that is what Curve::overshoots() means — but not by an unbounded amount. Where 2.0 comes from: it is the exact peak of an UNDAMPED spring (zeta = 0), which is the most a spring can overshoot at any stiffness. So the envelope is the spring ceiling, and no spring is ever touched by it. A cubic-bezier fits too, by construction — its y control points are themselves clamped to [-1, 2] at every entry point, and the curve stays within its control hull.
Elastic fits it EXACTLY, which is the nicest part. Its amplitude is the peak the curve reaches (see Easing::clampAmplitude), and that peak is capped at MaxCurveProgress — so elastic-out tops out at exactly 2.0 and elastic-in, its mirror, bottoms out at exactly -1.0. The two of them span the envelope precisely and neither can cross it. Nothing is ever clipped.
So the envelope is a no-op for every curve the library produces, and a real bound only on a hand-edited profile or a third-party CurveRegistry curve — the case that has no other defence, since such a curve supplies its own evaluate().
It must be enforced by the CONSUMERS rather than inside Curve::evaluate, because a third-party curve supplies its own evaluate() and would simply not call it. All three consumers bound against it, and they have to agree: the shader and the geometry animator are handed the same curve for the same window on the same event, so a bound applied to one and not the other would render the pixels and the window frame at different overshoots.
AnimatedValue (AnimatedValue.h, AnimatedValue_geometric.h) — the geometry animator, at the lerp and at the swept-bounds sampler,ShaderInternal::clampProgressForCurve (plasmazoneseffect/shader_internal.h) — the shader's iTime,PhosphorMotionAnimation (src/phosphormotionanimation.cpp) — the QML-facing bezier sampler, which bounds the same progress before it reaches a QML property.Do NOT apply it to a stateful curve's CurveState::value. That field is the integrator's own state, fed back into the next step(); clamping it would corrupt the physics rather than bound the output. Bound at the point of use.
|
constexpr |
Batch sequencing mode: 0 applies every window at once, 1 cascades them in zone order.
Shipped default is the cascade, and ConfigDefaults::animationSequenceMode() resolves to this value.
|
constexpr |