Skip to content

💫 Improve window animations#667

Merged
mrkai77 merged 2 commits into
mrkai77:developfrom
zenangst:improve/window-animations
Jan 10, 2025
Merged

💫 Improve window animations#667
mrkai77 merged 2 commits into
mrkai77:developfrom
zenangst:improve/window-animations

Conversation

@zenangst
Copy link
Copy Markdown
Contributor

@zenangst zenangst commented Jan 9, 2025

  • Use the current refresh rate of the current display for .frameRate.
  • Reduce the strain on the accessibility framework by never setting the same position or size twice. This should help reduce any redundant computation that might occur when the animation happens.
  • Use round on newFrame so that we don't try and render frames with subpixel precision and make the compare statements work as intended.

- Use the current refresh rate of the current display for `.frameRate`.
- Reduce the strain on the accessibility framework by never setting the same `position` or `size` twice.
  This should help reduce any redundant computation that might occur when the animation happens.
- Use `round` on `newFrame` so that we don't try and render frames with subpixel precision and make the
  compare statements work as intended.
@zenangst
Copy link
Copy Markdown
Contributor Author

zenangst commented Jan 9, 2025

Don't know if this is just me, but it does feel "smoother" with these changes. Could just be all in my head :)

Please take it for a spin to verify that the changes work as intended. I'm running them locally now.

Copy link
Copy Markdown
Owner

@mrkai77 mrkai77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works well! I also moved the display mode code into the NSScreen+Extensions file. While I didn’t notice a visible difference, this is a good improvement as it also potentially reduces unnecessary refreshes and resizes. Thank you! :)

@mrkai77 mrkai77 merged commit 82aac46 into mrkai77:develop Jan 10, 2025
@mrkai77 mrkai77 changed the title Improve window animations 💫 Improve window animations Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants