mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #3985 from thegrb93/master
Prevent windows from idling while playing a game with a gc controller
This commit is contained in:
commit
ac00b249aa
@ -198,8 +198,14 @@ bool MainWindow::Stop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stop)
|
if (stop)
|
||||||
|
{
|
||||||
ForceStop();
|
ForceStop();
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// Allow windows to idle or turn off display again
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return stop;
|
return stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,6 +264,13 @@ void MainWindow::StartGame(const QString& path)
|
|||||||
Settings().SetLastGame(path);
|
Settings().SetLastGame(path);
|
||||||
ShowRenderWidget();
|
ShowRenderWidget();
|
||||||
emit EmulationStarted();
|
emit EmulationStarted();
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// Prevents Windows from sleeping, turning off the display, or idling
|
||||||
|
EXECUTION_STATE shouldScreenSave =
|
||||||
|
SConfig::GetInstance().bDisableScreenSaver ? ES_DISPLAY_REQUIRED : 0;
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS | shouldScreenSave | ES_SYSTEM_REQUIRED);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ShowRenderWidget()
|
void MainWindow::ShowRenderWidget()
|
||||||
|
@ -1034,6 +1034,13 @@ void CFrame::StartGame(const std::string& filename)
|
|||||||
X11Utils::XWindowFromHandle(GetHandle()), true);
|
X11Utils::XWindowFromHandle(GetHandle()), true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Prevents Windows from sleeping, turning off the display, or idling
|
||||||
|
EXECUTION_STATE shouldScreenSave =
|
||||||
|
SConfig::GetInstance().bDisableScreenSaver ? ES_DISPLAY_REQUIRED : 0;
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS | shouldScreenSave | ES_SYSTEM_REQUIRED);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_RenderParent->SetFocus();
|
m_RenderParent->SetFocus();
|
||||||
|
|
||||||
wxTheApp->Bind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this);
|
wxTheApp->Bind(wxEVT_KEY_DOWN, &CFrame::OnKeyDown, this);
|
||||||
@ -1181,6 +1188,12 @@ void CFrame::OnStopped()
|
|||||||
X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()),
|
X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()),
|
||||||
X11Utils::XWindowFromHandle(GetHandle()), false);
|
X11Utils::XWindowFromHandle(GetHandle()), false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Allow windows to resume normal idling behavior
|
||||||
|
SetThreadExecutionState(ES_CONTINUOUS);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_RenderFrame->SetTitle(StrToWxStr(scm_rev_str));
|
m_RenderFrame->SetTitle(StrToWxStr(scm_rev_str));
|
||||||
|
|
||||||
// Destroy the renderer frame when not rendering to main
|
// Destroy the renderer frame when not rendering to main
|
||||||
|
Loading…
Reference in New Issue
Block a user