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

On MacOS Vsync does nothing (rendering occurs as fast as possible) if window is hidden #1364

Closed
kettle11 opened this issue Jul 22, 2021 · 1 comment

Comments

@kettle11
Copy link

This is easily tested by measuring time between frames, creating a window, and moving the window behind another window.

The frame time will drop to around 0. This effectively busy-loops and can quickly heat up a laptop or drain battery. I encountered a version of this issue (with a library similar to glutin) where I left a program running with my laptop closed and came back and it was super hot.

This is an issue other similar libraries have encountered as well:
libsdl-org/SDL#1871

Their solution was to insert a sleep when the window is not visible.

I put together a small repository that reproduces this issue: https://github.com/kettle11/winit_framerate_test

@kchibisov
Copy link
Member

The same would be on X11 as well. Given that you can contol vsync at runtime without any issue I don't think it matters now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants