Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💫 Improve window animations #667

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

zenangst
Copy link
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
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
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
1 check passed
@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