mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 05:41:16 +01:00
This commit adds window movement animations to komorebi for macOS, maintaining configuration API compatibility with komorebi for Windows. The animation system is adapted from the Windows implementation but uses macOS-specific APIs for screen update batching and accessibility control, and borrows heavily from the implementation details of animations in rift. In order to have decent performance, there are some calls to private APIS. For this reason, the animation feature will be marked as "UNSAFE". UNSAFE features should be expected to break between major operating system updates, and depending on which way I want to go, may only support one major macOS version at a time (i.e. they will not have a backwards compatibility guarantee with previous versions of macOS). This currently look awful when used with the Scrolling layout, but looks relatively good with other layouts. As with Windows, the animations when two windows of very different sizes change position aren't great. Some high level notes on the implementation: * Uses the private SkyLight framework for screen update batching via SLSDisableUpdate/SLSReenableUpdate - these APIs prevent visual flicker by compositing all window position changes at once rather than updating each window individually during layout operations * AnimationEngine runs animations in background threads with frame-based timing, supporting cancellation when new animations are triggered for the same window * MovementRenderDispatcher implements the RenderDispatcher trait to interpolate window positions using configurable easing functions * All 30+ easing styles from the Windows implementation are supported, including standard CSS-style functions and CubicBezier for custom curves * Enhanced User Interface (AXEnhancedUserInterface) is temporarily disabled during window positioning operations for better performance * The Transparency animation prefix is not supported on macOS as there is no equivalent to the Win32 transparency feature This feature is off-by-default and can be enabled in the static config or via komorebic commands (animation, animation-duration, animation-fps, animation-style).