diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1d9e25..34898d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 10.0.x + dotnet-version: 11.0.x - name: Restore run: dotnet restore CxShell.Tests/CxShell.Tests.csproj diff --git a/.github/workflows/macos-package.yml b/.github/workflows/macos-package.yml index a2a1268..c25efbb 100644 --- a/.github/workflows/macos-package.yml +++ b/.github/workflows/macos-package.yml @@ -34,7 +34,7 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" - name: Resolve package version id: version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0acc1d3..99b13e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ permissions: contents: write env: - DOTNET_VERSION: "10.0.x" + DOTNET_VERSION: "11.0.x" VCPKG_REF: "a7eda31dc16994fcaa8587982eb833a8695f1b6f" RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || inputs.tag_name }} @@ -360,7 +360,7 @@ jobs: $publishDir = Join-Path $env:GITHUB_WORKSPACE "artifacts\publish\$rid" $outputDir = Join-Path $env:GITHUB_WORKSPACE "artifacts\velopack\$rid" - dotnet tool install vpk --tool-path ".tmp\vpk" --version 1.2.0 + dotnet tool install vpk --tool-path ".tmp\vpk" --version 1.2.161 & ".tmp\vpk\vpk.exe" pack ` --packId "CxShell-$rid" ` --packVersion $version ` @@ -601,7 +601,7 @@ jobs: publish_dir="$GITHUB_WORKSPACE/artifacts/publish/$rid" output_dir="$GITHUB_WORKSPACE/artifacts/velopack/$rid" - dotnet tool install vpk --tool-path ".tmp/vpk" --version 1.2.0 + dotnet tool install vpk --tool-path ".tmp/vpk" --version 1.2.161 ".tmp/vpk/vpk" pack \ --packId "CxShell-$rid" \ --packVersion "$version" \ @@ -820,7 +820,7 @@ jobs: # probe normally, drop the bridge next to it, and let normal assembly # probing find the dylib. dotnet build tools/RdpSmokeTest/RdpSmokeTest.csproj --configuration Release - smoke_dir="$GITHUB_WORKSPACE/tools/RdpSmokeTest/bin/Release/net10.0" + smoke_dir="$GITHUB_WORKSPACE/tools/RdpSmokeTest/bin/Release/net11.0" find "$app_path/Contents/MacOS" -maxdepth 1 -name "*.dylib" -exec cp {} "$smoke_dir/" \; dotnet exec "$smoke_dir/RdpSmokeTest.dll" --probe diff --git a/AGENTS.md b/AGENTS.md index b53731e..4b1dd24 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Project Structure & Module Organization -CxShell is a single-project Avalonia desktop terminal and remote session client targeting .NET 10. The application entry points are `Program.cs`, `App.axaml`, and `App.axaml.cs`. +CxShell is a single-project Avalonia desktop terminal and remote session client targeting .NET 11. The application entry points are `Program.cs`, `App.axaml`, and `App.axaml.cs`. - `Views/`: Avalonia `.axaml` views and their code-behind files. - `ViewModels/`: MVVM presentation logic, commands, and observable state. @@ -67,7 +67,7 @@ RDP frame presentation latency (regression fix, 2026-11-23): pure repaint-wave d ## Full Screen Connection Bar -`Views/FullScreenConnectionBar.axaml(.cs)` is the mstsc-style floating bar shown at the top centre of a full screen window. It is hosted twice: by `Views/MainWindow.axaml` (bound to `MainWindowViewModel.IsTerminalFullScreen`, endpoint `SelectedTab.Session.Host`, quality `SelectedTab.Rdp.LinkQualityLevel`, `IsQualityVisible=SelectedTab.IsRdpSession`) and by `Views/DetachedTabWindow.axaml` (bound to the tab view model). Hosts wire `MinimizeRequested` / `RestoreRequested` / `CloseRequested` / `PinnedChanged`. +`Views/FullScreenConnectionBar.axaml(.cs)` is the mstsc-style floating bar shown at the top centre of a full screen window. It is hosted by `Views/MainWindow.axaml` (bound to `MainWindowViewModel.IsTerminalFullScreen`, endpoint `SelectedTab.Session.Host`, quality `SelectedTab.Rdp.LinkQualityLevel`, `IsQualityVisible=SelectedTab.IsRdpSession`), `Views/DetachedTabWindow.axaml` (bound to the tab view model), `Views/RdpWorkspaceWindow.axaml`, and `Views/RdpMonitorWindow.axaml`. Hosts wire `MinimizeRequested` / `RestoreRequested` / `CloseRequested` / `PinnedChanged` (and workspace/multi-monitor events where applicable). Behaviour that must not regress: @@ -78,14 +78,9 @@ Behaviour that must not regress: - The quality bars are an estimate, not an RDP capability: `RdpViewModel` times a bare TCP connect to the session endpoint every 10 s while connected and maps ≤50 ms/≤100 ms/≤200 ms/longer to 4/3/2/1 bars (`LinkQualityLevel`); 0 means unknown/disconnected. RDP exposes no signal strength, and a full reconnect probe must never be used. - Minimize from the bar leaves the full screen presentation, so the host must restore it when the window comes back: `MainWindow` uses `_restoreFullScreenAfterMinimize` plus `OnMainWindowPropertyChanged`; `DetachedTabWindow` needs `_restoreFullScreenAfterMinimize` / `_restoreKeepTaskbarAfterMinimize` and the `_suppressPresentationRestore` guard, because leaving the taskbar-visible mode changes `WindowState` and would otherwise look like a user restore. Close maps to `CloseTab(SelectedTab)` in the main window and `Close()` in a detached window - never to shutting down the application. - **Both full screen modes must hide the drawn chrome, not just the title bar.** `WindowState.FullScreen` only drops the native frame; AtomUI draws its title bar (`IsTitleBarVisible`) inside the client area. `Views/KeepTaskbarFullScreen.cs` owns that: `Enter()` hides the title bar before maximizing, the immersive path calls `HideTitleBar()`. -- **The full width bar that stays on top in full screen comes from Avalonia's `TopLevelHost`, not from the title bar and not from `WindowDecorations`.** `TopLevelHost` (internal, `src/Avalonia.Controls/TopLevelHost.Decorations.cs`) parents the window as a visual child and adds sibling layers: underlay, window, overlay, and a `LayerWrapper` with automation id `PopoverWindowChrome`. In full screen it hides underlay/overlay and enables `OnPointerMoved`: as soon as the pointer reaches the top 1 DIP it sets that popover layer visible; it hides again when the pointer moves below `DefaultTitleBarHeight`. The content of that layer is AtomUI's `WindowDrawnDecorationsTheme` `FullscreenHeaderFrame` - a `DefaultTitleBarHeight` (39 DIP) tall, window wide `Border` with `DefaultBackground` (`#141414`), the logo/title (both hidden when the window has no icon and no title) and the full screen/close `CaptionButton`s, which is why the band shows only a circular close button at the right edge. `WindowDecorations = None` does **not** remove it. -- **Suppressing that bar needs two things, and the layer is not reachable from the window's own descendants.** `KeepTaskbarFullScreen.SuppressFullscreenPopover()` walks *up* from the window through `GetVisualParent()` (the host is the window's visual parent, so this works even though `TopLevel` is a visual root for other purposes), searches the top level's visual tree for the control whose `AutomationProperties.AutomationId` is `PopoverWindowChrome`, then (a) sets `IsHitTestVisible = false` on the layer and (b) hides the `FullscreenHeaderFrame` border inside it. Hiding the layer itself does not stick: the hover handler sets `IsVisible = true` again on the next pointer move at the top edge. The frame is only built once the decoration template is applied, so callers retry ~800 ms after entering full screen (`DispatcherTimer.RunOnce` in `ApplyTerminalFullScreenState` / `DetachedTabWindow`), besides the immediate post at `DispatcherPriority.Loaded`. -- **AtomUI's own `PART_FullscreenPopoverLayer` is a second, different bar.** It only exists in the non-CSD window template (`Window/Themes/FullscreenPopoverLayerTheme.axaml`, template part of the `IsCsdEnabled=False` branch), so a CSD window (this app) finds nothing when searching for it - a not-found result there is expected and does not mean the bar is gone. -- **Verified on Avalonia 12.1.5 (runtime log, not inference).** `Full screen chrome dump` with the window in `state=FullScreen decorations=None titleBar=False` printed `root=TopLevelHost` with children `WindowChromeUnderlay(vis=False)`, `MainWindow`, `WindowChromeOverlay(vis=False)`, `PopoverWindowChrome`, `ResizeGripLayer`. The popover wrapper has `bounds=1707x960` and its `vis` flips `False -> True -> False` exactly when the pointer reaches the top edge, which is the smoking gun that this layer (not a title bar, not a content margin) paints the band. After suppression the wrapper still flips - Avalonia keeps toggling it, the hidden `FullscreenHeaderFrame` is what stops it painting. So **the wrapper's `IsVisible` is not a success signal**; `popoverSuppressed` is. -- **Suppression must be released on every exit.** The hidden `FullscreenHeaderFrame` belongs to the decoration template, which outlives the full screen session, so `ReleaseFullscreenPopoverSuppression()` (dispose the visibility subscription, restore `IsHitTestVisible`, re-show the frame, clear the flag) runs on all exit paths in `MainWindow` and `DetachedTabWindow`. Skipping it makes the next session report `popoverSuppressed=True` even when nothing was suppressed. -- Never grep the shipped `Avalonia.Controls.dll` for these names: .NET stores user string literals as UTF-16, so an ASCII search for `PopoverWindowChrome` returns 0 hits and looks like proof that the layer does not exist. Read the matching source tag instead (`https://raw.githubusercontent.com/AvaloniaUI/Avalonia/12.1.5/src/Avalonia.Controls/TopLevelHost.Decorations.cs`); the master branch diverges (`TopLevelHost` is a tiny file there and the decoration hosting moved). -- `HideDecorations()` (`Window.WindowDecorations = None`, previous value saved) stays as a separate concern: it drops Avalonia's drawn underlay/overlay so the window has no vendor chrome at all. All helpers are idempotent and capture their previous value only the first time, so switching between "keep taskbar" and immersive full screen never loses the original state. Restore them on every exit path (after the window has left full screen, never before), including a takeover by a path we do not control (window manager shortcut, native caption button): `MainWindow.OnMainWindowPropertyChanged` and `DetachedTabWindow.OnWindowPropertyChanged` restore the chrome whenever the window ends up outside full screen without `_keepTaskbarFullScreen.IsActive`. Never set `IsTitleBarVisible` or `WindowDecorations` from XAML for this - they must stay paired with the saved values. -- Do not trust `GetVisualDescendants().OfType()` as a diagnostic (CA2021: the type is not a `Visual`, the sequence is always empty, it reports `False` even when a popover is on screen - this cost two wrong fixes). Also do not trust a "no band sized control on the top edge" dump taken from the window subtree: the popover layer is a *sibling* of the window. The log field that tells whether the bar is gone is `popoverSuppressed=` in the `Full screen applied` / `Full screen chrome settled` / `Full screen left` lines; when it comes back `False`, `WriteFullScreenChromeDump()` prints the top level's layer list (it stays silent otherwise, so a working session logs one short line per transition). +- **AtomUI 6.3.0's built-in full-screen title bar must stay disabled via `FullScreenTitleBarMode="Hidden"`.** AtomUI 6.3.0 removed `FullscreenHeaderFrame` from `WindowDrawnDecorationsTheme` and introduced `Window.FullScreenTitleBarMode` (default `AutoHide`) inside `WindowChromeLayer`. Every window hosting `FullScreenConnectionBar` (`MainWindow.axaml`, `DetachedTabWindow.axaml`, `RdpWorkspaceWindow.axaml`, `RdpMonitorWindow.axaml`) must set `FullScreenTitleBarMode="Hidden"` so AtomUI never activates its built-in full-screen bar or moves `TitleBar` between `NormalSlotTitleBar` and `FullScreenSlotContent`. +- **Keep `FullScreenConnectionBar` as a dedicated control rather than replacing it with `Window.FullScreenTitleBar`.** `Window.FullScreenTitleBar` only activates for `WindowState.FullScreen`, whereas CxShell needs the same bar in taskbar-visible maximized mode (`KeepTaskbarFullScreen`) and `RdpMonitorWindow` borderless mode, with the centred 8 px / 500 ms mstsc hot-zone, RDP link quality, pin persistence, multi-monitor popup lock, workspace tab switching, and drag-restore. +- `KeepTaskbarFullScreen` owns `HideTitleBar`/`RestoreTitleBar` and `HideDecorations`/`RestoreDecorations` (`Window.WindowDecorations = None`, previous values saved once). Both helpers are idempotent so switching between "keep taskbar" and immersive full screen never loses the original state. Restore them on every exit path (after leaving full screen, never before), including an external takeover (window manager shortcut, native caption button): `MainWindow.OnMainWindowPropertyChanged` and `DetachedTabWindow.OnWindowPropertyChanged` restore the chrome whenever the window ends up outside full screen without `_keepTaskbarFullScreen.IsActive`. Never bind `IsTitleBarVisible` or `WindowDecorations` from XAML. ## X/Y/ZMODEM File Transfer diff --git a/App.axaml.cs b/App.axaml.cs index 857e08e..407a3d3 100644 --- a/App.axaml.cs +++ b/App.axaml.cs @@ -9,8 +9,8 @@ using AtomUI.Controls; using AtomUI.Desktop.Controls; using AtomUI.Theme; -using AtomUI.Theme.Algorithms; -using AtomUI.Theme.Configuration; +using AtomUI.DesignLanguages.AntDesign; +using AtomUI.Desktop.Controls.Themes.AntDesign; using CxShell.Models; using CxShell.Services; using CxShell.ViewModels; @@ -30,15 +30,19 @@ public override void Initialize() public static void ConfigureAtomUI(IAtomUIBuilder builder) { - var initialTheme = LoadInitialTheme(); - builder.WithInitialTheme(IThemeManager.DEFAULT_THEME_ID, initialTheme); + var initialTheme = LoadInitialThemeSelection(); builder.UseAlibabaSansFont(); builder.UseDesktopControls(); builder.UseDesktopColorPicker(); builder.UseDesktopDataGrid(); + builder.UseAntDesign(language => language + .AddDesktopControls() + .AddDesktopColorPicker() + .AddDesktopDataGrid()); + builder.WithInitialTheme(initialTheme); } - private static ThemeConfig LoadInitialTheme() + private static ThemeSelection LoadInitialThemeSelection() { var themeMode = ApplicationSettings.DarkThemeMode; @@ -52,16 +56,16 @@ private static ThemeConfig LoadInitialTheme() // Keep startup on the established dark theme if the settings file is unavailable. } - var algorithms = string.Equals( + var appearance = string.Equals( themeMode, ApplicationSettings.LightThemeMode, StringComparison.OrdinalIgnoreCase) - ? new[] { ThemeAlgorithm.Default } - : new[] { ThemeAlgorithm.Default, ThemeAlgorithm.Dark }; + ? ThemeAppearance.Light + : ThemeAppearance.Dark; - return new ThemeConfigBuilder() - .WithAlgorithms(algorithms) - .Build(); + return ThemeSelection.Of() + .WithTheme(AntDesignThemes.DaybreakBlue) + .WithAppearance(appearance); } public override void OnFrameworkInitializationCompleted() diff --git a/CxShell.Tests/CxShell.Tests.csproj b/CxShell.Tests/CxShell.Tests.csproj index 4dd3201..f7b5222 100644 --- a/CxShell.Tests/CxShell.Tests.csproj +++ b/CxShell.Tests/CxShell.Tests.csproj @@ -1,6 +1,6 @@ - net10.0 + net11.0 enable enable false @@ -8,13 +8,13 @@ - - - - - + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CxShell.csproj b/CxShell.csproj index f38a584..e61fa14 100644 --- a/CxShell.csproj +++ b/CxShell.csproj @@ -1,7 +1,7 @@ WinExe - net10.0 + net11.0 enable enable true @@ -58,25 +58,28 @@ - - - + + + + + + - - - + + + + - - - - - - + + + + + - - - + + + diff --git a/README.md b/README.md index 580c005..dd5d226 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ RDP sessions run inside the same tabbed workspace and share CxShell's session ma | Area | Technology | | --- | --- | -| Runtime | .NET 10 | +| Runtime | .NET 11 | | UI framework | Avalonia 12 | | UI components | AtomUI Desktop Controls 6 | | MVVM | CommunityToolkit.Mvvm | @@ -143,7 +143,7 @@ OpenCowork is an architectural reference only. CxShell does not start, embed, or ### Basic Application -- .NET 10 SDK +- .NET 11 SDK - Git - Windows 10/11, macOS 11+, or a mainstream Linux desktop environment diff --git a/README.zh-CN.md b/README.zh-CN.md index 0cc1683..9db80ae 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -63,7 +63,7 @@ RDP 会话直接运行在统一的标签工作区中,并复用 CxShell 的会 | 领域 | 技术 | | --- | --- | -| 运行时 | .NET 10 | +| 运行时 | .NET 11 | | UI 框架 | Avalonia 12 | | UI 控件 | AtomUI Desktop Controls 6 | | MVVM | CommunityToolkit.Mvvm | @@ -143,7 +143,7 @@ OpenCowork 仅作为架构研究参考。CxShell 不启动、不嵌入,也不 ### 基础应用 -- .NET 10 SDK +- .NET 11 SDK - Git - Windows 10/11、macOS 11+ 或主流 Linux 桌面环境 diff --git a/ThirdParty/VelaShell.XServer/VelaShell.XServer.csproj b/ThirdParty/VelaShell.XServer/VelaShell.XServer.csproj index c9dbfd8..9ce7349 100644 --- a/ThirdParty/VelaShell.XServer/VelaShell.XServer.csproj +++ b/ThirdParty/VelaShell.XServer/VelaShell.XServer.csproj @@ -23,7 +23,7 @@ --> - net10.0 + net11.0 enable enable preview diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index 436cdd8..8a5e6b5 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -10,8 +10,7 @@ using AtomUI; using AtomUI.Controls; using AtomUI.Theme; -using AtomUI.Theme.Algorithms; -using AtomUI.Theme.Configuration; +using AtomUI.DesignLanguages.AntDesign; using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; @@ -375,18 +374,13 @@ private async Task ApplyThemeModeAsync(string mode) if (themeManager == null) return; - var currentTheme = themeManager.CurrentTheme; - var algorithms = currentTheme?.Algorithms?.ToList() ?? [ThemeAlgorithm.Default]; - var newMode = !string.Equals(mode, ApplicationSettings.LightThemeMode, StringComparison.OrdinalIgnoreCase); - algorithms.RemoveAll(static algorithm => algorithm == ThemeAlgorithm.Dark); - if (newMode) - algorithms.Add(ThemeAlgorithm.Dark); + var appearance = string.Equals(mode, ApplicationSettings.LightThemeMode, StringComparison.OrdinalIgnoreCase) + ? ThemeAppearance.Light + : ThemeAppearance.Dark; - var result = await themeManager.ApplyThemeAsync( - new ThemeRequest( - currentTheme?.ThemeId ?? IThemeManager.DEFAULT_THEME_ID, - new ThemeConfigBuilder().WithAlgorithms(algorithms.ToArray()).Build(), - ThemeTransitionReason.UserRequest)); + var baseSelection = themeManager.CurrentSelection + ?? ThemeSelection.Of().WithTheme(AntDesignThemes.DaybreakBlue); + var result = await themeManager.ApplyAsync(baseSelection.WithAppearance(appearance)); if (result.Status == ThemeTransitionStatus.Failed) return; diff --git a/Views/DetachedTabWindow.axaml b/Views/DetachedTabWindow.axaml index d5494de..2be8310 100644 --- a/Views/DetachedTabWindow.axaml +++ b/Views/DetachedTabWindow.axaml @@ -15,6 +15,7 @@ MinHeight="320" WindowStartupLocation="CenterScreen" IsFullScreenCaptionButtonVisible="True" + FullScreenTitleBarMode="Hidden" Background="{atom:SharedTokenResource ColorBgLayout}">