Prevent Display Sleep on Windows while running a game (#1850)

Co-authored-by: EliEron <example@example.com>
This commit is contained in:
EliEron 2021-01-25 00:02:00 +01:00 committed by GitHub
parent ddf1105bcb
commit ad491b5570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 1 deletions

View file

@ -554,6 +554,8 @@ namespace Ryujinx.Ui
_windowsMultimediaTimerResolution = new WindowsMultimediaTimerResolution(1);
}
DisplaySleep.Prevent();
GlRendererWidget = new GlRenderer(_emulationContext, ConfigurationState.Instance.Logger.GraphicsDebugLevel);
Application.Invoke(delegate
@ -604,6 +606,7 @@ namespace Ryujinx.Ui
_windowsMultimediaTimerResolution?.Dispose();
_windowsMultimediaTimerResolution = null;
DisplaySleep.Restore();
_viewBox.Remove(GlRendererWidget);
_viewBox.Add(_gameTableWindow);