Skip to content

Commit 60696c9

Browse files
committed
#3: WPF demo does not show a dark title bar, fails on CI but not locally
1 parent 7c5e354 commit 60696c9

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

DarkNet/DarkNet.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public class DarkNet: IDarkNet {
3939
private bool? _userDefaultAppThemeIsDark;
4040
private bool? _userTaskbarThemeIsDark;
4141
private Theme? _preferredAppMode;
42-
private int _processThemeChanged; // int instead of bool to support Interlocked atomic operations
42+
43+
private volatile int _processThemeChanged; // int instead of bool to support Interlocked atomic operations
4344

4445
/// <inheritdoc />
4546
public event EventHandler<bool>? UserDefaultAppThemeIsDarkChanged;
@@ -146,7 +147,7 @@ private static bool IsWindowVisible(IntPtr windowHandle) {
146147
}
147148

148149
private void ImplicitlySetProcessThemeIfFirstCall(Theme theme) {
149-
if (Interlocked.CompareExchange(ref _processThemeChanged, 1, 0) == 0) {
150+
if (_processThemeChanged == 0) {
150151
SetCurrentProcessTheme(theme);
151152
}
152153
}

DarkNet/DarkNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
5-
<Version>2.0.0</Version>
5+
<Version>2.0.1</Version>
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>
88
<UseWindowsForms>true</UseWindowsForms>

darknet-demo-wpf/Properties/PublishProfiles/FolderProfile.pubxml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
7-
<Configuration>Release</Configuration>
8-
<Platform>Any CPU</Platform>
9-
<PublishDir>bin\Release\net6.0-windows\publish\win-x86\</PublishDir>
10-
<PublishProtocol>FileSystem</PublishProtocol>
11-
<TargetFramework>net6.0-windows</TargetFramework>
12-
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
13-
<SelfContained>false</SelfContained>
14-
<PublishSingleFile>true</PublishSingleFile>
15-
<PublishReadyToRun>false</PublishReadyToRun>
16-
</PropertyGroup>
6+
<PropertyGroup>
7+
<Configuration>Release</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>bin\Release\net6.0-windows\win-x86\publish\</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<TargetFramework>net6.0-windows</TargetFramework>
12+
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
13+
<SelfContained>false</SelfContained>
14+
<PublishSingleFile>true</PublishSingleFile>
15+
<PublishReadyToRun>false</PublishReadyToRun>
16+
</PropertyGroup>
1717
</Project>

0 commit comments

Comments
 (0)