Use SDL3 screen saver functions to implement AllowScreenSuspension

This removes the custom Android and iOS implementations, and also adds support for desktop platforms.
This commit is contained in:
Susko3
2024-04-30 12:35:21 +02:00
parent 5071dacc9e
commit fac74e00ac
5 changed files with 22 additions and 20 deletions

View File

@@ -30,15 +30,6 @@ namespace osu.Framework.iOS
protected override IWindow CreateWindow(GraphicsSurfaceType preferredSurface) => new IOSWindow(preferredSurface, Options.FriendlyGameName);
protected override void SetupForRun()
{
base.SetupForRun();
AllowScreenSuspension.Result.BindValueChanged(allow =>
InputThread.Scheduler.Add(() => UIApplication.SharedApplication.IdleTimerDisabled = !allow.NewValue),
true);
}
protected override void SetupConfig(IDictionary<FrameworkSetting, object> defaultOverrides)
{
if (!defaultOverrides.ContainsKey(FrameworkSetting.ExecutionMode))