From befd884e3a4d8a815732659f15c852939a1ff7c9 Mon Sep 17 00:00:00 2001 From: jess Date: Thu, 23 Apr 2026 07:01:07 -0700 Subject: [PATCH] dingwl --- README.md | 6 ++++-- shell/windows/LayersShell/LayersShell.csproj | 2 ++ shell/windows/LayersShell/MainWindow.xaml.cs | 6 +----- shell/windows/LayersShell/WinKeyMap.cs | 7 ------- src/bin/layers_shell.rs | 3 --- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index db039fb..5fa012f 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,12 @@ In PowerShell: ```powershell winget install Microsoft.DotNet.SDK.8 +dotnet workload install maui-windows ``` -The Windows App SDK is pulled in automatically via NuGet when the shell builds — no extra -workload install needed. +The Windows App SDK itself is pulled in via NuGet when the shell builds. The +`maui-windows` workload supplies the MSBuild tasks that WinUI 3's PRI/MRT targets +reach for, which would otherwise only be available with a full Visual Studio install. #### 6. Build + install diff --git a/shell/windows/LayersShell/LayersShell.csproj b/shell/windows/LayersShell/LayersShell.csproj index 8329328..a852cdf 100644 --- a/shell/windows/LayersShell/LayersShell.csproj +++ b/shell/windows/LayersShell/LayersShell.csproj @@ -15,6 +15,8 @@ true Layers false + false + false Assets\app.ico $(MSBuildProjectDirectory)\..\..\..\resources\Layers.svg diff --git a/shell/windows/LayersShell/MainWindow.xaml.cs b/shell/windows/LayersShell/MainWindow.xaml.cs index cdb198a..06b41ea 100644 --- a/shell/windows/LayersShell/MainWindow.xaml.cs +++ b/shell/windows/LayersShell/MainWindow.xaml.cs @@ -44,7 +44,6 @@ public sealed partial class MainWindow : Window appWindow.ResizeClient(new SizeInt32((int)DefaultLogicalWidth, (int)DefaultLogicalHeight)); } - // Windows App SDK 1.3+: assign a backdrop directly, no MicaController wiring needed. SystemBackdrop = new MicaBackdrop { Kind = Microsoft.UI.Composition.SystemBackdrops.MicaKind.Base }; Activated += OnActivated; @@ -94,8 +93,7 @@ public sealed partial class MainWindow : Window var height = (float)RenderSurface.ActualHeight; if (width <= 0 || height <= 0 || scale <= 0) return; - // wgpu's dx12 backend wants an ISwapChainPanelNative*. Query it off the XAML element's - // IUnknown rather than passing the raw WinRT object pointer. + // wgpu's dx12 backend wants an ISwapChainPanelNative*, not the raw IUnknown. var iid = typeof(ISwapChainPanelNative).GUID; var unknown = Marshal.GetIUnknownForObject(RenderSurface); IntPtr native = IntPtr.Zero; @@ -140,8 +138,6 @@ public sealed partial class MainWindow : Window } } - // --- Input routing --- - private void RenderSurface_SizeChanged(object sender, SizeChangedEventArgs e) { if (_handle == IntPtr.Zero) diff --git a/shell/windows/LayersShell/WinKeyMap.cs b/shell/windows/LayersShell/WinKeyMap.cs index c5734cc..96c6fcc 100644 --- a/shell/windows/LayersShell/WinKeyMap.cs +++ b/shell/windows/LayersShell/WinKeyMap.cs @@ -4,11 +4,6 @@ using Windows.System; namespace LayersShell; -/// Maps WinUI virtual keys to the `layers_key_event` named-code + text protocol. -/// named: 0=Character, 1=Enter, 2=Escape, 3=Backspace, 4=Tab, -/// 5=ArrowLeft, 6=ArrowRight, 7=ArrowUp, 8=ArrowDown, -/// 9=Delete, 10=Home, 11=End. -/// mods: 1=Shift, 2=Ctrl, 4=Alt, 8=Logo (Win). internal static class WinKeyMap { public static uint MapVirtualKey(VirtualKey key) => key switch @@ -29,8 +24,6 @@ internal static class WinKeyMap public static string? TextForKey(VirtualKey key) { - // Letters + digits + punctuation produced by the shell directly. Shift/altgr composition - // is left to the iced layer's text_input which re-evaluates the character path. if (key >= VirtualKey.A && key <= VirtualKey.Z) { char c = (char)('a' + (int)(key - VirtualKey.A)); diff --git a/src/bin/layers_shell.rs b/src/bin/layers_shell.rs index a6bd8fd..57981f8 100644 --- a/src/bin/layers_shell.rs +++ b/src/bin/layers_shell.rs @@ -245,9 +245,6 @@ fn init_logging() { .try_init(); } -/// Locate the installed plugin root so colours.toml and other resources resolve. -/// Honours `LAYERS_PLUGIN_ROOT` first; otherwise walks up from the running binary -/// expecting `/bin/`. fn discover_plugin_root() -> Option { if let Ok(p) = std::env::var("LAYERS_PLUGIN_ROOT") { let pb = PathBuf::from(p);