diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8f3a4382..ebf1316f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "3.1.0", + "version": "6.0.0", "commands": [ "dotnet-cake" ] diff --git a/Changelog.md b/Changelog.md index c986fa2b..96953867 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,17 @@ # Changelog for ControlzEx +## 7.0.3 (preview) + +### Bug fixes + +- [#216](../../issues/216) - KeyboardNavigationEx.AlwaysShowFocusVisual may cause the application to get stuck in an infinite focus loop (thanks @myd7349) +- [#222](../../issues/222) - Non-client area hit test feature doesn't work properly when view box is involved + +### Maintenance + +- [#218](../../issues/218) - Remove workaround fro already added member (thanks @DoctorKrolic) +- [#219](../../issues/219) - Remove unused box type (thanks @DoctorKrolic) + ## 7.0.2 ### Bug fixes diff --git a/GitVersion.yml b/GitVersion.yml index abfd088d..84b2e4d7 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,21 +1,27 @@ assembly-versioning-scheme: Major assembly-file-versioning-scheme: MajorMinorPatchTag -next-version: 7.0.0 mode: ContinuousDeployment +next-version: 7.0.0 branches: master: - regex: ^main - mode: ContinuousDeployment - tag: rc - prevent-increment-of-merged-branch-version: true + regex: ^master$|^main$ + label: rc + prevent-increment: + of-merged-branch: true track-merge-target: false is-release-branch: true + is-main-branch: true + increment: Patch develop: - mode: ContinuousDeployment - tag: alpha - prevent-increment-of-merged-branch-version: true + regex: ^develop$ + label: alpha + prevent-increment: + of-merged-branch: true track-merge-target: true + tracks-release-branches: true + is-main-branch: false + increment: Patch pull-request: mode: ContinuousDelivery ignore: - sha: [] + sha: [] \ No newline at end of file diff --git a/README.md b/README.md index 90612ab3..98afdf8c 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ - The roadmap is done by [milestones](../../milestones). - [Releases and Release Notes](../../releases) - Development requirements - - .NET SDK 8.0.401 or later - - An IDE that supports the required .NET SDK (for example Rider 2024.1, Visual Studio 2022 (17.10) or later) + - .NET SDK 10.0.100 or later + - An IDE that supports the required .NET SDK ## TextBoxInputMaskBehavior diff --git a/appveyor.yml b/appveyor.yml index e3adfcb0..47cfbb71 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,12 @@ branches: - main - /\d*\.\d*\.\d*/ +image: Visual Studio 2022 +test: false + +pull_requests: + do_not_increment_build_number: false + environment: azure-key-vault-url: secure: 1mKS/HfCVq+iYNRVSrrN8NEowOkKt3knrpMzw+SOy3g= @@ -16,28 +22,16 @@ environment: secure: CUpRJxMLeUZwNPMcqI0wECaWfy5AMnWn1UZhBd9WnQ3Z16lJP1Vzrkf24mccbhUD azure-key-vault-certificate: secure: BSPdW2TgnQtoQXXbeDECug== - -image: Visual Studio 2022 -test: false + IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1 install: - # Appveyor uses git checkout -qf FETCH_HEAD but all GitVersion versions above 5.6.3 doesn't support this detached header - # This is a workaround for this issue - - ps: | - if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne "") - { - git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) - } - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' - - ps: ./dotnet-install.ps1 -Version 8.0.100 -InstallDir "C:\Program Files\dotnet" - -pull_requests: - do_not_increment_build_number: false + - ps: ./dotnet-install.ps1 -JSonFile ./global.json -InstallDir "C:\Program Files\dotnet" build_script: - ps: dotnet --info - - ps: gitversion /version - - ps: .\build.ps1 --target=CI + - ps: git status + - ps: .\build.ps1 --target=CI -v verbose after_build: - ps: gci -Filter *.trx -Path .\TestResults\ | % { (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $_.FullName)) } diff --git a/build.cake b/build.cake index 4966204a..3eb568d7 100644 --- a/build.cake +++ b/build.cake @@ -6,7 +6,7 @@ #tool dotnet:?package=AzureSignTool&version=4.0.1 #tool dotnet:?package=GitReleaseManager.Tool&version=0.15.0 -#tool nuget:?package=GitVersion.CommandLine&version=5.12.0 +#tool dotnet:?package=GitVersion.Tool&version=6.5.1 /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS @@ -25,8 +25,6 @@ var solution = srcDir + "/ControlzEx.sln"; var publishDir = baseDir + "/Publish"; var testResultsDir = Directory(baseDir + "/TestResults"); -var gitVersionPath = Context.Tools.Resolve("gitversion.exe"); - public class BuildData { public string Configuration { get; } @@ -51,7 +49,7 @@ public class BuildData public void SetGitVersion(GitVersion gitVersion) { GitVersion = gitVersion; - IsPrerelease = GitVersion.NuGetVersion.Contains("-"); + IsPrerelease = GitVersion.FullSemVer.Contains("-"); } } @@ -83,20 +81,19 @@ Setup(ctx => // Set build version for CI if (buildData.IsLocalBuild == false || buildData.Verbosity == Verbosity.Verbose) { - GitVersion(new GitVersionSettings { ToolPath = gitVersionPath, OutputType = GitVersionOutput.BuildServer }); + GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.BuildServer }); } - buildData.SetGitVersion(GitVersion(new GitVersionSettings { ToolPath = gitVersionPath, OutputType = GitVersionOutput.Json })); + buildData.SetGitVersion(GitVersion(new GitVersionSettings { OutputType = GitVersionOutput.Json })); - Information("GitVersion : {0}", gitVersionPath); Information("Branch : {0}", buildData.GitVersion.BranchName); Information("Configuration : {0}", buildData.Configuration); Information("IsLocalBuild : {0}", buildData.IsLocalBuild); Information("IsPrerelease : {0}", buildData.IsPrerelease); Information("Informational Version: {0}", buildData.GitVersion.InformationalVersion); Information("SemVer Version: {0}", buildData.GitVersion.SemVer); + Information("FullSemVer Version: {0}", buildData.GitVersion.FullSemVer); Information("AssemblySemVer Version: {0}", buildData.GitVersion.AssemblySemVer); Information("MajorMinorPatch Version: {0}", buildData.GitVersion.MajorMinorPatch); - Information("NuGet Version: {0}", buildData.GitVersion.NuGetVersion); Information("Verbosity : {0}", buildData.Verbosity); Information("Publish folder : {0}", publishDir); @@ -138,7 +135,7 @@ Task("Build") var msbuildSettings = new DotNetMSBuildSettings { MaxCpuCount = 0, - Version = data.GitVersion.NuGetVersion, + Version = data.GitVersion.FullSemVer, AssemblyVersion = data.GitVersion.AssemblySemVer, FileVersion = data.GitVersion.AssemblySemFileVer, InformationalVersion = data.GitVersion.InformationalVersion, @@ -174,7 +171,7 @@ Task("Pack") var msbuildSettings = new DotNetMSBuildSettings { MaxCpuCount = 0, - Version = data.GitVersion.NuGetVersion, + Version = data.GitVersion.FullSemVer, AssemblyVersion = data.GitVersion.AssemblySemVer, FileVersion = data.GitVersion.AssemblySemFileVer, InformationalVersion = data.GitVersion.InformationalVersion @@ -287,7 +284,7 @@ Task("Zip") } else { - Zip(zipDir, publishDir + "/ControlzEx.Showcase.v" + data.GitVersion.NuGetVersion + ".zip"); + Zip(zipDir, publishDir + "/ControlzEx.Showcase.v" + data.GitVersion.FullSemVer + ".zip"); } }); diff --git a/global.json b/global.json new file mode 100644 index 00000000..10d86daa --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "10.0.100", + "rollForward": "feature" + } +} diff --git a/src/ControlzEx/Behaviors/WindowChrome/NonClientControlManager.cs b/src/ControlzEx/Behaviors/WindowChrome/NonClientControlManager.cs index 479e452e..45e3c543 100644 --- a/src/ControlzEx/Behaviors/WindowChrome/NonClientControlManager.cs +++ b/src/ControlzEx/Behaviors/WindowChrome/NonClientControlManager.cs @@ -168,7 +168,7 @@ public bool ClickTrackedControl(IntPtr lParam) while (currentControl is not null) { var valueSource = DependencyPropertyHelper.GetValueSource(currentControl, NonClientControlProperties.HitTestResultProperty); - if (valueSource.BaseValueSource is not BaseValueSource.Inherited and not BaseValueSource.Unknown) + if (valueSource.BaseValueSource is not BaseValueSource.Default and not BaseValueSource.Inherited and not BaseValueSource.Unknown) { control = currentControl; break; diff --git a/src/ControlzEx/Internal/DWMHelper.cs b/src/ControlzEx/Internal/DWMHelper.cs index 8caed415..6ec82932 100644 --- a/src/ControlzEx/Internal/DWMHelper.cs +++ b/src/ControlzEx/Internal/DWMHelper.cs @@ -67,8 +67,7 @@ public static bool SetImmersiveDarkMode(IntPtr hWnd, bool isDarkTheme) public static bool SetBackdropType(IntPtr hWnd, WindowBackdropType windowBackdropType) { - const DWMWINDOWATTRIBUTE DWMWA_SYSTEMBACKDROP_TYPE = (DWMWINDOWATTRIBUTE)38; - return SetWindowAttributeValue(hWnd, DWMWA_SYSTEMBACKDROP_TYPE, (int)windowBackdropType); + return SetWindowAttributeValue(hWnd, DWMWINDOWATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE, (int)windowBackdropType); } } } \ No newline at end of file diff --git a/src/ControlzEx/Internal/KnownBoxes/StringBoxes.cs b/src/ControlzEx/Internal/KnownBoxes/StringBoxes.cs deleted file mode 100644 index 84c591e9..00000000 --- a/src/ControlzEx/Internal/KnownBoxes/StringBoxes.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace ControlzEx.Internal.KnownBoxes -{ - /// - /// Class containing boxed values for . - /// - internal static class StringBoxes - { - /// - /// Gets a boxed value for . - /// - internal static readonly object Empty = string.Empty; - } -} \ No newline at end of file diff --git a/src/ControlzEx/KeyboardNavigationEx.cs b/src/ControlzEx/KeyboardNavigationEx.cs index f47a95ba..0b3ef800 100644 --- a/src/ControlzEx/KeyboardNavigationEx.cs +++ b/src/ControlzEx/KeyboardNavigationEx.cs @@ -59,7 +59,7 @@ internal bool AlwaysShowFocusVisualInternal /// The element which will be focused. public static void Focus(UIElement? element) { - element?.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => + element?.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { var keybHack = Instance; var alwaysShowFocusVisual = keybHack.AlwaysShowFocusVisualInternal; diff --git a/src/ControlzEx/WindowChromeWindow.MessageHandling.cs b/src/ControlzEx/WindowChromeWindow.MessageHandling.cs index cf07bd6f..cf0a4df0 100644 --- a/src/ControlzEx/WindowChromeWindow.MessageHandling.cs +++ b/src/ControlzEx/WindowChromeWindow.MessageHandling.cs @@ -100,8 +100,8 @@ private IntPtr HandleERASEBKGND(WM uMsg, nuint wParam, nint lParam, out bool han if (PInvoke.GetClientRect(this.windowHandle, &rect) == true) { var brush = WindowsThemeHelper.AppsUseLightTheme() - ? new HBRUSH(PInvoke.GetStockObject(GET_STOCK_OBJECT_FLAGS.WHITE_BRUSH)) - : new HBRUSH(PInvoke.GetStockObject(GET_STOCK_OBJECT_FLAGS.BLACK_BRUSH)); + ? new HBRUSH((IntPtr)PInvoke.GetStockObject(GET_STOCK_OBJECT_FLAGS.WHITE_BRUSH)) + : new HBRUSH((IntPtr)PInvoke.GetStockObject(GET_STOCK_OBJECT_FLAGS.BLACK_BRUSH)); var dc = new HDC(new IntPtr((nint)wParam)); if (PInvoke.FillRect(dc, &rect, brush) != 0) diff --git a/src/Directory.packages.props b/src/Directory.packages.props index 47b250eb..db06a40e 100644 --- a/src/Directory.packages.props +++ b/src/Directory.packages.props @@ -13,15 +13,15 @@ - - + + - + - - + + diff --git a/src/global.json b/src/global.json deleted file mode 100644 index 81e632ac..00000000 --- a/src/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sdk": { - "version": "8.0.100", - "rollForward": "feature", - "allowPrerelease": false - } -} \ No newline at end of file