Skip to main content

apply_system_reduce_motion

Function apply_system_reduce_motion 

Source
pub fn apply_system_reduce_motion(cx: &mut App)
Expand description

Reads the operating system’s reduced-motion preference into App::set_reduce_motion.

gpui_base::init calls this once. Call it again to re-read the preference on a platform Base does not follow live — macOS and Windows post no notification Base can subscribe to without a window, so a change made while the application runs reaches it only through this call.

The application wins over the system: when the flag no longer holds what Base last wrote, the application set it, and this call leaves it alone. Where the platform cannot say (wasm, an unsupported desktop, a Linux session without the portal) the flag is left as it is, and under GPUI’s test scheduler the platform is not asked at all.