Skip to content

Commit 18705bb

Browse files
committed
Improved program responsiveness on startup
1 parent aac9eb9 commit 18705bb

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

PinStats/App.xaml.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Microsoft.UI.Xaml.Controls;
99
using LiveChartsCore;
1010
using LiveChartsCore.SkiaSharpView;
11+
using H.NotifyIcon.EfficiencyMode;
1112

1213
namespace PinStats;
1314

@@ -118,9 +119,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)
118119
{
119120
base.OnLaunched(args);
120121
LaunchEmptyWindowIfNotExists();
121-
122-
// Set the process priority to high to improve performance.
123-
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
124122
}
125123

126124
private static Window s_emptyWindow;
@@ -159,5 +157,11 @@ private async void OnEmptyWindowContentLoaded(object sender, RoutedEventArgs e)
159157
var resource = new TaskbarUsageResource();
160158
Resources.Add("TaskbarUsageResources", resource);
161159
await CheckForUpdateAsync();
160+
161+
// Disable efficiency mode to improve performance.
162+
EfficiencyModeUtilities.SetEfficiencyMode(false);
163+
164+
// Set the process priority to high to improve performance.
165+
Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.High;
162166
}
163167
}

PinStats/MonitorWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using H.NotifyIcon.EfficiencyMode;
21
using Microsoft.UI.Windowing;
32
using Microsoft.UI.Xaml;
43
using Microsoft.UI.Xaml.Media;

PinStats/PopupWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
VerticalAlignment="Center"
3131
Stretch="UniformToFill" />
3232
<Rectangle Fill="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}" />
33+
<Rectangle Fill="{ThemeResource LayerOnMicaBaseAltFillColorDefaultBrush}" Opacity="0.5" />
3334
</Grid>
3435

3536
<Grid

0 commit comments

Comments
 (0)