Commit 8410e61
authored
Throttle framerate when V-sync is enabled but window is not focused.
RetroArch hogs an entire CPU core when running in the background with V-sync enabled. It seems that when the window is fully obscured by other windows, V-sync ceases to work, allowing RetroArch to run at an unlimited framerate, thrashing the CPU.
As a workaround, the framerate is now throttled when the window is not in focus. I would rather have it throttle when the window is not visible, but there does not seem to be a way of detecting that.
Note that this is only known to be the case on Windows: I don't know what the situation is for Linux and other operating systems, though macOS does suffer from this exact same problem, according to this SDL issue:
libsdl-org/SDL#45211 parent b0624a7 commit 8410e61
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7402 | 7402 | | |
7403 | 7403 | | |
7404 | 7404 | | |
7405 | | - | |
| 7405 | + | |
7406 | 7406 | | |
7407 | 7407 | | |
7408 | 7408 | | |
| |||
7542 | 7542 | | |
7543 | 7543 | | |
7544 | 7544 | | |
7545 | | - | |
| 7545 | + | |
| 7546 | + | |
7546 | 7547 | | |
7547 | 7548 | | |
7548 | 7549 | | |
| |||
0 commit comments