Skip to content

Commit ab2ca92

Browse files
committed
fix scaling issue after .NET 8 update
1 parent f08dcb7 commit ab2ca92

21 files changed

+331
-345
lines changed

ColorControl/ColorControl.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PublisherName>Maassoft</PublisherName>
1919
<Company>Maassoft</Company>
2020
<ApplicationRevision>0</ApplicationRevision>
21-
<ApplicationVersion>9.8.2.0</ApplicationVersion>
22-
<Version>9.8.2.0</Version>
21+
<ApplicationVersion>9.8.2.1</ApplicationVersion>
22+
<Version>9.8.2.1</Version>
2323
<UseApplicationTrust>false</UseApplicationTrust>
2424
<PublishWizardCompleted>true</PublishWizardCompleted>
2525
<BootstrapperEnabled>false</BootstrapperEnabled>

ColorControl/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using ColorControl.Forms;
22
using ColorControl.Services.AMD;
33
using ColorControl.Services.Common;
4-
using ColorControl.Services.EventDispatcher;
54
using ColorControl.Services.GameLauncher;
65
using ColorControl.Services.LG;
76
using ColorControl.Services.NVIDIA;
87
using ColorControl.Services.Samsung;
98
using ColorControl.Shared.Common;
109
using ColorControl.Shared.Contracts;
10+
using ColorControl.Shared.EventDispatcher;
1111
using ColorControl.Shared.Forms;
1212
using ColorControl.Shared.Native;
1313
using ColorControl.Shared.Services;

ColorControl/Program.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using ColorControl.Forms;
22
using ColorControl.Services.Common;
3-
using ColorControl.Services.EventDispatcher;
43
using ColorControl.Services.GameLauncher;
54
using ColorControl.Services.LG;
65
using ColorControl.Services.NVIDIA;
76
using ColorControl.Services.Samsung;
87
using ColorControl.Shared.Common;
98
using ColorControl.Shared.Contracts;
9+
using ColorControl.Shared.EventDispatcher;
1010
using ColorControl.Shared.Native;
1111
using ColorControl.Shared.Services;
1212
using ColorControl.Svc;
@@ -73,11 +73,6 @@ static async Task MainAsync(string[] args)
7373
return;
7474
}
7575

76-
var host = CreateHostBuilder().Build();
77-
ServiceProvider = host.Services;
78-
79-
var mutexId = $"Global\\{typeof(MainForm).GUID}";
80-
8176
var currentDomain = AppDomain.CurrentDomain;
8277
// Handler for unhandled exceptions.
8378
currentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
@@ -86,16 +81,24 @@ static async Task MainAsync(string[] args)
8681

8782
LoadConfig();
8883

84+
if (Config.UseGdiScaling)
85+
{
86+
var result = Application.SetHighDpiMode(HighDpiMode.DpiUnawareGdiScaled);
87+
88+
Logger.Debug($"Result of setting SetHighDpiMode: {result}");
89+
}
90+
91+
var host = CreateHostBuilder().Build();
92+
ServiceProvider = host.Services;
93+
94+
var mutexId = $"Global\\{typeof(MainForm).GUID}";
95+
8996
var appContextProvider = ServiceProvider.GetRequiredService<AppContextProvider>();
9097
var startUpParams = StartUpParams.Parse(args);
9198

9299
AppContext = new GlobalContext(Config, startUpParams, DataDir, _loggingRule, mutexId);
93100
appContextProvider.SetAppContext(AppContext);
94101

95-
if (Config.UseGdiScaling)
96-
{
97-
Application.SetHighDpiMode(HighDpiMode.DpiUnawareGdiScaled);
98-
}
99102

100103
var existingProcess = Utils.GetProcessByName("ColorControl");
101104

ColorControl/Services/Common/PresetBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using ColorControl.Services.EventDispatcher;
2-
using ColorControl.Shared.Common;
1+
using ColorControl.Shared.Common;
32
using ColorControl.Shared.Contracts;
3+
using ColorControl.Shared.EventDispatcher;
44
using NStandard;
55
using System;
66
using System.Collections.Generic;

ColorControl/Services/Common/ServiceBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ColorControl.Services.EventDispatcher;
1+
using ColorControl.Shared.EventDispatcher;
22
using ColorControl.Shared.Native;
33
using ColorControl.Shared.Services;
44
using Newtonsoft.Json;

ColorControl/Services/EventDispatcher/EventExtensions.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

ColorControl/Services/EventDispatcher/PowerEventDispatcher.cs

Lines changed: 0 additions & 117 deletions
This file was deleted.

ColorControl/Services/EventDispatcher/ProcessEventDispatcher.cs

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)