From c846d2635b15fdf70612f84b9de19d462de412f3 Mon Sep 17 00:00:00 2001 From: Taiizor <41683699+Taiizor@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:59:24 +0300 Subject: [PATCH] Preparing Backgroundog --- .../Sucrose.Backgroundog/Extension/AudioSession.cs | 1 + .../Sucrose.Backgroundog/Helper/Initialize.cs | 1 + .../Sucrose.Backgroundog/Helper/Specification.cs | 13 +++++++++---- src/Project/Sucrose.Backgroundog/Manage/Internal.cs | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Project/Sucrose.Backgroundog/Extension/AudioSession.cs b/src/Project/Sucrose.Backgroundog/Extension/AudioSession.cs index bf9ede933..1b2b4390f 100644 --- a/src/Project/Sucrose.Backgroundog/Extension/AudioSession.cs +++ b/src/Project/Sucrose.Backgroundog/Extension/AudioSession.cs @@ -44,6 +44,7 @@ private static void SetCurrentSession() { ThumbnailString = SBET.Create(Thumbnail); Thumbnail.Flush(); + Thumbnail.Dispose(); } } diff --git a/src/Project/Sucrose.Backgroundog/Helper/Initialize.cs b/src/Project/Sucrose.Backgroundog/Helper/Initialize.cs index b6f52f99e..d2774d128 100644 --- a/src/Project/Sucrose.Backgroundog/Helper/Initialize.cs +++ b/src/Project/Sucrose.Backgroundog/Helper/Initialize.cs @@ -14,6 +14,7 @@ internal class Initialize : IDisposable public void Start() { SBMI.Computer.Open(); + TimerCallback Callback = InitializeTimer_Callback; SBMI.InitializeTimer = new(Callback, null, 0, SBMI.InitializeTime); diff --git a/src/Project/Sucrose.Backgroundog/Helper/Specification.cs b/src/Project/Sucrose.Backgroundog/Helper/Specification.cs index 0896bff56..bb43e7efa 100644 --- a/src/Project/Sucrose.Backgroundog/Helper/Specification.cs +++ b/src/Project/Sucrose.Backgroundog/Helper/Specification.cs @@ -8,6 +8,7 @@ using SBEUV = Sucrose.Backgroundog.Extension.UpdateVisitor; using SBEV = Sucrose.Backgroundog.Extension.Virtual; using SBMI = Sucrose.Backgroundog.Manage.Internal; +using SBMM = Sucrose.Backgroundog.Manage.Manager; using SBSSSS = Sucrose.Backgroundog.Struct.Sensor.SensorStruct; using SECNT = Skylark.Enum.ClearNumericType; using SEMST = Skylark.Enum.ModeStorageType; @@ -16,6 +17,8 @@ using SMC = Sucrose.Memory.Constant; using SMMI = Sucrose.Manager.Manage.Internal; using SMMM = Sucrose.Manager.Manage.Manager; +using SSDECPT = Sucrose.Shared.Dependency.Enum.CategoryPerformanceType; +using SSDEPT = Sucrose.Shared.Dependency.Enum.PerformanceType; using SSDSHS = Sucrose.Shared.Dependency.Struct.HostStruct; using SSEPPE = Skylark.Standard.Extension.Ping.PingExtension; using SSESSE = Skylark.Standard.Extension.Storage.StorageExtension; @@ -352,6 +355,8 @@ public static async Task Start() if (!SBMI.FocusDesktop) { + SWUS.Initialize(); + foreach (SSMMS Screen in SWUS.Screens) { if (SWHF.IsFullscreen(Foreground, Screen.rcMonitor)) @@ -376,7 +381,7 @@ public static async Task Start() }); } - if (SBMI.VirtualityManagement) + if (SBMI.VirtualityManagement && (SBMM.VirtualPerformance != SSDEPT.Resume || SBMI.CategoryPerformance == SSDECPT.Virtual)) { SBMI.VirtualityManagement = false; @@ -386,7 +391,7 @@ public static async Task Start() { SBMI.Virtuality = SBEV.VirtualityActive(); - await Task.Delay(SBMI.InitializeTime * 8); + await Task.Delay(SBMI.InitializeTime * 4); SBMI.VirtualityManagement = true; } @@ -418,7 +423,7 @@ public static async Task Start() }); } - if (SBMI.RemoteManagement) + if (SBMI.RemoteManagement && (SBMM.RemotePerformance != SSDEPT.Resume || SBMI.CategoryPerformance == SSDECPT.Remote)) { SBMI.RemoteManagement = false; @@ -428,7 +433,7 @@ public static async Task Start() { SBMI.RemoteDesktop = SBER.DesktopActive(); - await Task.Delay(SBMI.InitializeTime * 8); + await Task.Delay(SBMI.InitializeTime * 4); SBMI.RemoteManagement = true; } diff --git a/src/Project/Sucrose.Backgroundog/Manage/Internal.cs b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs index cab9eb653..b8b6f7181 100644 --- a/src/Project/Sucrose.Backgroundog/Manage/Internal.cs +++ b/src/Project/Sucrose.Backgroundog/Manage/Internal.cs @@ -22,7 +22,7 @@ internal static class Internal { public static bool Exit = true; - public static int AppTime = 250; + public static int AppTime = 1000; public static Process App = null; @@ -38,7 +38,7 @@ internal static class Internal public static bool Virtuality = false; - public static int InitializeTime = 250; + public static int InitializeTime = 500; public static bool FocusDesktop = false;