This commit is contained in:
jess 2026-04-23 07:01:07 -07:00
parent ed82d65c3e
commit befd884e3a
5 changed files with 7 additions and 17 deletions

View File

@ -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

View File

@ -15,6 +15,8 @@
<PublishReadyToRun>true</PublishReadyToRun>
<AssemblyName>Layers</AssemblyName>
<EnableMrtResourceIndexer>false</EnableMrtResourceIndexer>
<GenerateAppxPriFile>false</GenerateAppxPriFile>
<ShouldComputeInputPris>false</ShouldComputeInputPris>
<ApplicationIcon Condition="Exists('Assets\app.ico')">Assets\app.ico</ApplicationIcon>
<LayersIconSvg>$(MSBuildProjectDirectory)\..\..\..\resources\Layers.svg</LayersIconSvg>

View File

@ -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)

View File

@ -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));

View File

@ -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 `<plugin_root>/bin/<exe>`.
fn discover_plugin_root() -> Option<PathBuf> {
if let Ok(p) = std::env::var("LAYERS_PLUGIN_ROOT") {
let pb = PathBuf::from(p);