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
Qt: Disable Display Sleep when game is running (Windows) #3008
Conversation
Can you please drop the first two commits |
I uh, am currently trying to do this. I'm still new to git and pull requests, so sorry for the delay. |
No worries |
Done. |
I uh, don't have any idea how this is failing on arm if the code is only compiled for the Qt Build, and only if it's windows. This change shouldn't impact anything, much less rendering code! |
That's actually checking for graphical rendering errors, but it plays up sometimes, that's just a false positive. |
Ah good c: |
'Qt' not 'QT'. And I don't know anything about the Win32 API stuff so I can't really review, sorry. |
Basically it signals windows "Hey, I have some content that the person is watching / playing, and I wouldn't like the screen to turn off". It then undo's this. I verified the functionality with MSDN |
So if dolphin crashes while a game is playing, what happens? Does the screensaver state return to normal, or is the system stuck in a no-screensaver state? |
The command enables a flag on the process. If the process crashes, then there is no flag telling windows what to do. This means that Windows would revert to normal - as there is no process keeping it from sleeping anymore. |
void DMainWindow::DisableScreensaver() | ||
{ | ||
#ifdef Q_OS_WIN | ||
// TODO: Prevent display from sleeping. This only currently prevents the system from truely sleeping. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
You're correct, DISPLAY_REQUIRED keeps the screen on (it's what video players like VLC use). However, I made a mistake with the comment, which was made when I was using a different method. I can push a commit to fix the comment. |
Can you squash your commits and use |
Disables Display Sleeping on Windows on DolphinQt while the game runs, and re-enables it after the game closes.
Done |
LGTM |
1 similar comment
LGTM |
Qt: Disable Display Sleep when game is running (Windows)
This PR lays the groundwork for Power Management on Game start and end, as well as disables monitor sleeping on Windows. This is only while a game is running, and is re-enabled after it has finished.