Don't prevent windows Display Sleep while paused
This commit is contained in:
parent
9b94662b4b
commit
551719fe37
1 changed files with 18 additions and 2 deletions
|
@ -343,7 +343,10 @@ namespace Ryujinx.Ava
|
||||||
_windowsMultimediaTimerResolution = new WindowsMultimediaTimerResolution(1);
|
_windowsMultimediaTimerResolution = new WindowsMultimediaTimerResolution(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplaySleep.Prevent();
|
Dispatcher.UIThread.Post(() =>
|
||||||
|
{
|
||||||
|
DisplaySleep.Prevent();
|
||||||
|
});
|
||||||
|
|
||||||
NpadManager.Initialize(Device, ConfigurationState.Instance.Hid.InputConfig, ConfigurationState.Instance.Hid.EnableKeyboard, ConfigurationState.Instance.Hid.EnableMouse);
|
NpadManager.Initialize(Device, ConfigurationState.Instance.Hid.InputConfig, ConfigurationState.Instance.Hid.EnableKeyboard, ConfigurationState.Instance.Hid.EnableMouse);
|
||||||
TouchScreenManager.Initialize(Device);
|
TouchScreenManager.Initialize(Device);
|
||||||
|
@ -456,7 +459,10 @@ namespace Ryujinx.Ava
|
||||||
_gpuDoneEvent.WaitOne();
|
_gpuDoneEvent.WaitOne();
|
||||||
_gpuDoneEvent.Dispose();
|
_gpuDoneEvent.Dispose();
|
||||||
|
|
||||||
DisplaySleep.Restore();
|
Dispatcher.UIThread.Post(() =>
|
||||||
|
{
|
||||||
|
DisplaySleep.Restore();
|
||||||
|
});
|
||||||
|
|
||||||
NpadManager.Dispose();
|
NpadManager.Dispose();
|
||||||
TouchScreenManager.Dispose();
|
TouchScreenManager.Dispose();
|
||||||
|
@ -727,6 +733,11 @@ namespace Ryujinx.Ava
|
||||||
|
|
||||||
internal void Resume()
|
internal void Resume()
|
||||||
{
|
{
|
||||||
|
Dispatcher.UIThread.Post(() =>
|
||||||
|
{
|
||||||
|
DisplaySleep.Prevent();
|
||||||
|
});
|
||||||
|
|
||||||
Device?.System.TogglePauseEmulation(false);
|
Device?.System.TogglePauseEmulation(false);
|
||||||
|
|
||||||
_viewModel.IsPaused = false;
|
_viewModel.IsPaused = false;
|
||||||
|
@ -736,6 +747,11 @@ namespace Ryujinx.Ava
|
||||||
|
|
||||||
internal void Pause()
|
internal void Pause()
|
||||||
{
|
{
|
||||||
|
Dispatcher.UIThread.Post(() =>
|
||||||
|
{
|
||||||
|
DisplaySleep.Restore();
|
||||||
|
});
|
||||||
|
|
||||||
Device?.System.TogglePauseEmulation(true);
|
Device?.System.TogglePauseEmulation(true);
|
||||||
|
|
||||||
_viewModel.IsPaused = true;
|
_viewModel.IsPaused = true;
|
||||||
|
|
Loading…
Reference in a new issue