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

Prevent windows from idling while playing a game with a gc controller #3985

Merged
merged 1 commit into from Jul 11, 2016
Merged

Conversation

thegrb93
Copy link
Contributor

@thegrb93 thegrb93 commented Jul 7, 2016

I don't have a build environment to test this and the setup for VS2015 gives me errors so if someone could take this over, I'd appreciate it. This is basically #3008 which got lost in the move to qt2, except I added a flag that prevents windows from idling. Basically, if there are no keyboard or mouse inputs for a certain amount of time, windows will enter an idle state and start running background processes which make dolphin lag pretty bad. Hopefully this code will fix this issue: https://bugs.dolphin-emu.org/issues/9655


This change is Reviewable

@RisingFog
Copy link
Member

is this a Qt specific issue? Does this issue occur on wx?

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Whatever the current windows dolphin 5.0 release uses. It would probably happen on wx too, but I don't know.

@RisingFog
Copy link
Member

we use wx, so this fix would not apply.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

It needs to be added to wx as well then. I can do that real quick.

@mbc07
Copy link
Contributor

mbc07 commented Jul 7, 2016

I can confirm this occurs on WX on Windows, at least when playing exclusively with real Wiimotes...

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

I amended my commit with the WX additions. I put it next to the X11 code that prevents screensaver.

@mbc07
Copy link
Contributor

mbc07 commented Jul 7, 2016

I see you tied the code to bDisableScreensaver. AFAIK this is related to the screen saving option from Wii Menu, not the actual screen saver from the host computer...

@magumagu
Copy link
Contributor

magumagu commented Jul 7, 2016

@dolphin-emu-bot rebuild

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Ah sorry, I'll fix that, and the lint error too.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Hope that works.

@magumagu
Copy link
Contributor

magumagu commented Jul 7, 2016

I'm pretty sure bDisableScreensaver is actually the right thing to check... it's currently tied to the code which disables the screensaver on Windows. See also 62e790f.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Yeah, looking at the InhibitScreensaver shows code related to linux's screensaver program so you're right. Amended again.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Looks like I can download the binary, so I'll test it.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Works. Played about 8 matches of melee with no problem. Went back to 5.0 and after 2 matches, windows disk defrag starts up and starts lagging the game. Testing DolphinQT now

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

Doesn't work for DolphinQt2. Weird. Any ideas?

@phire
Copy link
Member

phire commented Jul 7, 2016

Uh, ignore that DolphinQT binary, it's a stale build left over from another PR.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

That or Q_OS_WIN isn't defined.

@phire
Copy link
Member

phire commented Jul 7, 2016

No, I'm 100% sure that's the case.

Qt doesn't build on windows until #3981, and that's not merged yet.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 7, 2016

All right

@JMC47
Copy link
Contributor

JMC47 commented Jul 11, 2016

I've run into this issue with Real Wiimotes before, so I'm happy to see this change.

ForceStop();

#ifdef Q_OS_WIN
// Allow windows to idle or turn off display again
SetThreadExecutionState(ES_CONTINUOUS);

This comment was marked as off-topic.

@thegrb93
Copy link
Contributor Author

thegrb93 commented Jul 11, 2016

Now the screensaver option is present in both and both will always prevent idle processes from running so people won't have to try figuring out why their game is lagging for some unknown reason.

@thegrb93
Copy link
Contributor Author

Fixed the lint error

@delroth delroth merged commit ac00b24 into dolphin-emu:master Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants