From 2ea796d9eccfba56e7f60ba0ec6f579cea8388b7 Mon Sep 17 00:00:00 2001 From: vgm Date: Mon, 5 Oct 2026 23:23:30 +0800 Subject: [PATCH 1/3] build: migrate to Avalonia 12.1.3 Upgrade Avalonia and DataGrid, update the AvaloniaEdit submodule to its Avalonia 12 compatibility commit, and migrate the affected input, window, text rendering, clipboard, binding and XAML APIs. Use compiled bindings for the code-defined bindings to preserve Native AOT support. Keep platform detection on X11 in this commit. Preserve undecorated Linux custom windows and pin a valid .NET 10 SDK feature-band version. Validation: offline restore, Release Native AOT publish, formatter and whitespace checks, and an isolated X11 startup opening the local repository. --- depends/AvaloniaEdit | 2 +- global.json | 4 ++-- src/App.axaml.cs | 4 ---- src/Native/Linux.cs | 5 ++--- src/Native/MacOS.cs | 3 +-- src/Native/Windows.cs | 3 +-- src/Resources/Styles.axaml | 6 +++--- src/SourceGit.csproj | 12 ++++++------ src/Views/AIAssistant.axaml.cs | 1 + src/Views/AddRemote.axaml | 6 +++--- src/Views/AddSubmodule.axaml | 4 ++-- src/Views/AddWorktree.axaml | 4 ++-- src/Views/Apply.axaml | 2 +- src/Views/Archive.axaml | 2 +- src/Views/Avatar.cs | 13 +++++-------- src/Views/BinaryFileViewer.axaml | 2 +- src/Views/BranchTree.axaml.cs | 2 +- src/Views/ChangeSubmoduleUrl.axaml | 2 +- src/Views/CheckoutAsWorktree.axaml | 2 +- src/Views/CheckoutRemoteBranchAsWorktree.axaml | 4 ++-- src/Views/Clone.axaml | 6 +++--- src/Views/CommitChanges.axaml | 2 +- src/Views/CommitMessageToolBox.axaml | 2 +- src/Views/CommitMessageToolBox.axaml.cs | 2 +- src/Views/CommitSubjectPresenter.cs | 2 +- src/Views/Compare.axaml | 2 +- src/Views/ControlExtensions.cs | 1 + src/Views/ConventionalCommitMessageBuilder.axaml | 8 ++++---- src/Views/CreateBranch.axaml | 2 +- src/Views/CreateTag.axaml | 4 ++-- src/Views/DateTimePresenter.cs | 16 ++++------------ src/Views/EditRemote.axaml | 6 +++--- src/Views/ExecuteCustomAction.axaml | 4 ++-- src/Views/GitFlowStart.axaml | 2 +- src/Views/InitGitFlow.axaml | 2 +- src/Views/MergeConflictEditor.axaml.cs | 4 ++-- src/Views/MoveSubmodule.axaml | 2 +- src/Views/Preferences.axaml | 10 +++++----- src/Views/RenameBranch.axaml | 2 +- src/Views/Repository.axaml | 2 +- src/Views/RepositoryConfigure.axaml | 8 ++++---- src/Views/RepositoryToolbar.axaml.cs | 2 +- src/Views/RevisionCompare.axaml | 2 +- src/Views/RevisionFileContentViewer.axaml.cs | 1 + src/Views/RevisionFiles.axaml | 2 +- src/Views/SSHKeyHelper.axaml | 4 ++-- src/Views/SetSubmoduleBranch.axaml | 2 +- src/Views/StashChanges.axaml | 2 +- src/Views/SubmoduleRevisionCompare.axaml | 2 +- src/Views/TextDiffView.axaml.cs | 4 ++-- src/Views/Welcome.axaml | 2 +- src/Views/WorkingCopy.axaml | 2 +- 52 files changed, 91 insertions(+), 106 deletions(-) diff --git a/depends/AvaloniaEdit b/depends/AvaloniaEdit index ddf00a91dc..358f2c9e4a 160000 --- a/depends/AvaloniaEdit +++ b/depends/AvaloniaEdit @@ -1 +1 @@ -Subproject commit ddf00a91dc0da29b85c79b85c9583860213a99ff +Subproject commit 358f2c9e4ac57667c0183bf68f8869b110a69b1e diff --git a/global.json b/global.json index 32035c6564..d46d21e50b 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "10.0.0", - "rollForward": "latestMajor", + "version": "10.0.100", + "rollForward": "latestFeature", "allowPrerelease": false } } diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 66882b4869..82a5d5c4d4 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -7,11 +7,9 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Data.Core.Plugins; using Avalonia.Markup.Xaml; using Avalonia.Media; using Avalonia.Media.Fonts; -using Avalonia.Platform; using Avalonia.Styling; using Avalonia.Threading; @@ -251,8 +249,6 @@ public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - BindingPlugins.DataValidators.RemoveAt(0); - // Disable tooltip if window is not active. ToolTip.ToolTipOpeningEvent.AddClassHandler((c, e) => { diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 3d09f82663..96a616a6fd 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -7,7 +7,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; namespace SourceGit.Native { @@ -28,12 +27,12 @@ public void SetupWindow(Window window) if (OS.UseSystemWindowFrame) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.Default; + window.WindowDecorations = WindowDecorations.Full; window.ExtendClientAreaToDecorationsHint = false; } else { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; + window.WindowDecorations = WindowDecorations.None; window.ExtendClientAreaToDecorationsHint = true; window.Classes.Add("custom_window_frame"); } diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 06d09e8fa3..59e731a159 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -8,7 +8,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; namespace SourceGit.Native { @@ -50,7 +49,7 @@ public void SetupApp(AppBuilder builder) public void SetupWindow(Window window) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome; + window.WindowDecorations = WindowDecorations.Full; window.ExtendClientAreaToDecorationsHint = true; window.BorderThickness = new Thickness(0); } diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index fde6cb25a7..0349012b4a 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -9,7 +9,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; using Avalonia.Threading; namespace SourceGit.Native @@ -48,7 +47,7 @@ public void SetupApp(AppBuilder builder) public void SetupWindow(Window window) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; + window.WindowDecorations = WindowDecorations.BorderOnly; window.ExtendClientAreaToDecorationsHint = true; window.BorderThickness = new Thickness(1); window.Padding = new Thickness(0); diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index d1ba76c821..2455a5043f 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -19,7 +19,7 @@ - + @@ -57,7 +57,7 @@