基于WebView2实现的Win11桌面框架,利用插件自定义
chunhualin1
2026-08-17 9b5711d3124622b1f1b18500d442c76492da877a
src/Moli.Desktop/Host/DefaultContentInstaller.cs
@@ -155,6 +155,11 @@
                    changed = true;
                }
                if (RepairManifestClickThrough(manifest, layout.Instances))
                {
                    changed = true;
                }
                continue;
            }
@@ -225,6 +230,33 @@
        return changed;
    }
    /// <summary>
    /// Heal instances whose persisted clickThrough drifted from the plugin default.
    /// Interactive plugins (e.g. LLM palette) ship with clickThrough=false; "恢复默认"
    /// used to force true for every widget and left them permanently unclickable.
    /// </summary>
    private static bool RepairManifestClickThrough(PluginManifest manifest, IList<WidgetLayout> layouts)
    {
        if (manifest.DefaultLayout.ClickThrough)
        {
            return false;
        }
        var changed = false;
        var pluginId = new PluginId(manifest.Id);
        for (var index = 0; index < layouts.Count; index++)
        {
            var layout = layouts[index];
            if (layout.PluginId == pluginId && layout.ClickThrough)
            {
                layouts[index] = layout with { ClickThrough = false };
                changed = true;
            }
        }
        return changed;
    }
    private static bool IsAudioVisualizer(PluginManifest manifest)
        => string.Equals(manifest.Id, "sample.audio-visualizer", StringComparison.OrdinalIgnoreCase);