From f4ed8ae123abc1f48d2a3139a3aeccd128ff7b58 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 06:47:06 +0000 Subject: [PATCH 1/3] Initial plan From 5366d156380bd8f0bff3cd35d2c79be6caefe75a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 06:52:49 +0000 Subject: [PATCH 2/3] Fix: Set Normal process priority for logon startup task The default priority for Windows Task Scheduler tasks is Low (7), which causes Flow Launcher to be sluggish when other processes are consuming CPU. Explicitly set the task priority to Normal when creating the logon startup task. Also update CheckLogonTask() to recreate the task if the priority is not Normal, so existing users with the incorrect priority get automatically fixed on next startup. Co-authored-by: Jack251970 <53996452+Jack251970@users.noreply.github.com> --- Flow.Launcher/Helper/AutoStartup.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/Helper/AutoStartup.cs b/Flow.Launcher/Helper/AutoStartup.cs index 34700c61015..3bb9e69c64c 100644 --- a/Flow.Launcher/Helper/AutoStartup.cs +++ b/Flow.Launcher/Helper/AutoStartup.cs @@ -64,7 +64,9 @@ private static bool CheckLogonTask() if (task.Definition.Actions.FirstOrDefault() is Microsoft.Win32.TaskScheduler.Action taskAction) { var action = taskAction.ToString().Trim(); - if (!action.Equals(Constant.ExecutablePath, StringComparison.OrdinalIgnoreCase)) + var needsRecreation = !action.Equals(Constant.ExecutablePath, StringComparison.OrdinalIgnoreCase) + || task.Definition.Settings.Priority != System.Diagnostics.ProcessPriorityClass.Normal; + if (needsRecreation) { UnscheduleLogonTask(); ScheduleLogonTask(); @@ -184,6 +186,7 @@ private static bool ScheduleLogonTask() td.Settings.StopIfGoingOnBatteries = false; td.Settings.DisallowStartIfOnBatteries = false; td.Settings.ExecutionTimeLimit = TimeSpan.Zero; + td.Settings.Priority = System.Diagnostics.ProcessPriorityClass.Normal; try { From fc3860cca46d3876b36f40e157edf4deb974beb1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 24 Feb 2026 15:02:21 +0800 Subject: [PATCH 3/3] Improve code quality --- Flow.Launcher/Helper/AutoStartup.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Helper/AutoStartup.cs b/Flow.Launcher/Helper/AutoStartup.cs index 3bb9e69c64c..1f057f83990 100644 --- a/Flow.Launcher/Helper/AutoStartup.cs +++ b/Flow.Launcher/Helper/AutoStartup.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using System.Security.Principal; using Flow.Launcher.Infrastructure; @@ -65,7 +66,7 @@ private static bool CheckLogonTask() { var action = taskAction.ToString().Trim(); var needsRecreation = !action.Equals(Constant.ExecutablePath, StringComparison.OrdinalIgnoreCase) - || task.Definition.Settings.Priority != System.Diagnostics.ProcessPriorityClass.Normal; + || task.Definition.Settings.Priority != ProcessPriorityClass.Normal; if (needsRecreation) { UnscheduleLogonTask(); @@ -186,7 +187,7 @@ private static bool ScheduleLogonTask() td.Settings.StopIfGoingOnBatteries = false; td.Settings.DisallowStartIfOnBatteries = false; td.Settings.ExecutionTimeLimit = TimeSpan.Zero; - td.Settings.Priority = System.Diagnostics.ProcessPriorityClass.Normal; + td.Settings.Priority = ProcessPriorityClass.Normal; try {