Skip to content

Commit

Permalink
#3: WPF demo does not show a dark title bar, fails on CI but not locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldaviva committed Oct 5, 2022
1 parent 7c5e354 commit 60696c9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions DarkNet/DarkNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public class DarkNet: IDarkNet {
private bool? _userDefaultAppThemeIsDark;
private bool? _userTaskbarThemeIsDark;
private Theme? _preferredAppMode;
private int _processThemeChanged; // int instead of bool to support Interlocked atomic operations

private volatile int _processThemeChanged; // int instead of bool to support Interlocked atomic operations

/// <inheritdoc />
public event EventHandler<bool>? UserDefaultAppThemeIsDarkChanged;
Expand Down Expand Up @@ -146,7 +147,7 @@ public class DarkNet: IDarkNet {
}

private void ImplicitlySetProcessThemeIfFirstCall(Theme theme) {
if (Interlocked.CompareExchange(ref _processThemeChanged, 1, 0) == 0) {
if (_processThemeChanged == 0) {
SetCurrentProcessTheme(theme);
}
}
Expand Down
2 changes: 1 addition & 1 deletion DarkNet/DarkNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
22 changes: 11 additions & 11 deletions darknet-demo-wpf/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows\publish\win-x86\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows\win-x86\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>

0 comments on commit 60696c9

Please sign in to comment.