From df6a437518d89eebfa1a583e09ec99c462e64e47 Mon Sep 17 00:00:00 2001
From: Moli <13026959681@163.com>
Date: 星期三, 12 八月 2026 20:42:12 +0800
Subject: [PATCH] 移除发布文件的跟踪
---
src/Moli.Desktop/Windows/WallpaperWindow.cs | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/Moli.Desktop/Windows/WallpaperWindow.cs b/src/Moli.Desktop/Windows/WallpaperWindow.cs
index 5ffeba5..a639f2e 100644
--- a/src/Moli.Desktop/Windows/WallpaperWindow.cs
+++ b/src/Moli.Desktop/Windows/WallpaperWindow.cs
@@ -9,6 +9,7 @@
using Moli.Desktop.Plugins;
using Moli.Desktop.Runtime;
using Moli.Desktop.WebView;
+using Brushes = System.Windows.Media.Brushes;
namespace Moli.Desktop.Windows;
@@ -22,7 +23,6 @@
private readonly DesktopPaths _paths;
private readonly IDiagnosticsService _diagnostics;
private bool _clickThrough = true;
- private double _opacity = 1;
public WallpaperWindow(
PluginDescriptor plugin,
@@ -58,7 +58,7 @@
public async Task LoadAsync(WallpaperRuntimeState state, CancellationToken cancellationToken = default)
{
_clickThrough = state.ClickThrough;
- _opacity = state.Opacity;
+ Opacity = Math.Clamp(state.Opacity, 0.1, 1.0);
await _webView.InitializeAsync(new WebViewHostOptions
{
UserDataFolder = Path.Combine(_paths.WebViewDataDirectory, "wallpaper", _plugin.Id.Value),
@@ -76,7 +76,6 @@
public void ApplyState(WallpaperRuntimeState state, bool safeInputMode)
{
_clickThrough = !safeInputMode && state.ClickThrough;
- _opacity = state.Opacity;
Opacity = Math.Clamp(state.Opacity, 0.1, 1.0);
ApplyWin32Styles();
}
@@ -123,9 +122,9 @@
{
_interop.SetToolWindow(hwnd, true);
_interop.SetNoActivate(hwnd, true);
- _interop.SetLayered(hwnd, true, ToAlpha(_opacity));
+ _interop.SetLayered(hwnd, true);
_interop.SetClickThrough(hwnd, _clickThrough);
- _interop.MoveToDesktopLayer(hwnd, DesktopLayerMode.WorkerW, _monitor);
+ _interop.MoveToDesktopLayer(hwnd, DesktopLayerMode.WorkerW, _monitor, _monitor.Bounds);
}
catch (Exception ex)
{
@@ -136,6 +135,4 @@
new Dictionary<string, string> { ["pluginId"] = _plugin.Id.Value, ["exception"] = ex.GetType().Name });
}
}
-
- private static byte ToAlpha(double opacity) => (byte)Math.Round(Math.Clamp(opacity, 0.1, 1.0) * 255);
}
--
Gitblit v1.9.1