Web panel host fix round 1: non-fatal process kinds, late failures, thread restart, focus and permission guards
- ProcessFailed: only BrowserProcessExited (teardown) and RenderProcessExited (about:blank, recreate on the next Open) fail the panel, as WebView2's docs describe the kinds; GPU, utility, sandbox, PPAPI and frame-only renderer exits are logged only. RenderProcessUnresponsive fails it at 3 reports within 30 s. The handler acts on the panel being served now. - Fail decides "ignored" under the lock first and hides the panel only when the failure is live: a late failure for a superseded handle no longer hides the newer panel. - The panel thread's finally restarts the thread when an Open is still queued and the host is not shutting down; _threadDone goes false only after StartStaThread returns. - Show takes the foreground only when a window of this process (or of this panel's WebView2 browser process) holds it, never while the foreground is null. The visibility rule counts the browser process (CoreWebView2.BrowserProcessId) as ours, so the page's own dialogs do not hide the panel. - ClipboardRead is allowed only for an allowlisted origin. NavigationStarting and NewWindowRequested fail closed on an exception. - WebPanelApiRules: the ABI glue's pure parts (refusals, GetState Size check, state write), tested in WebPanelTests with WebPanelNativeArgs. WebPanelApi.LiveHandle and the browser pid in Describe for Task 4. - Harness: GpuProcessCrashKeepsPanel and LateFailureForSupersededHandle (both RED before the fix), UnloadWhileVisibleCollected reports UNVERIFIED when the window was not visible, the game-side key count is informational. EngineSettingsTests: WebPanel default-on round trip and setter case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f130be3d2b
commit
388f3fd908
9 changed files with 427 additions and 64 deletions
|
|
@ -58,6 +58,7 @@ namespace EngineSettingsTests
|
|||
Run(nameof(MaxHotReloadsReadAndKept), MaxHotReloadsReadAndKept);
|
||||
Run(nameof(CloseOnServerDisconnectDefaultOnAndSaved), CloseOnServerDisconnectDefaultOnAndSaved);
|
||||
Run(nameof(TransitionGateDefaultOnAndSaved), TransitionGateDefaultOnAndSaved);
|
||||
Run(nameof(WebPanelDefaultOnAndSaved), WebPanelDefaultOnAndSaved);
|
||||
Run(nameof(HoldReloadInWorldOptInAndSaved), HoldReloadInWorldOptInAndSaved);
|
||||
Run(nameof(IltServerNamesEdit), IltServerNamesEdit);
|
||||
Run(nameof(DisplaySettingsDefaultsAndSaved), DisplaySettingsDefaultsAndSaved);
|
||||
|
|
@ -118,6 +119,8 @@ namespace EngineSettingsTests
|
|||
case "dcclose-on": EngineSettings.CloseOnServerDisconnect = true; break;
|
||||
case "tgate-off": EngineSettings.TransitionGate = false; break;
|
||||
case "tgate-on": EngineSettings.TransitionGate = true; break;
|
||||
case "webpanel-off": EngineSettings.WebPanel = false; break;
|
||||
case "webpanel-on": EngineSettings.WebPanel = true; break;
|
||||
case "borderless-on": EngineSettings.BorderlessWindowed = true; break;
|
||||
case "borderless-off": EngineSettings.BorderlessWindowed = false; break;
|
||||
case "layout-on": EngineSettings.RememberWindowLayout = true; break;
|
||||
|
|
@ -148,6 +151,7 @@ namespace EngineSettingsTests
|
|||
Console.WriteLine("MaxHotReloads=" + EngineSettings.MaxHotReloads);
|
||||
Console.WriteLine("CloseOnServerDisconnect=" + EngineSettings.CloseOnServerDisconnect);
|
||||
Console.WriteLine("TransitionGate=" + EngineSettings.TransitionGate);
|
||||
Console.WriteLine("WebPanel=" + EngineSettings.WebPanel);
|
||||
Console.WriteLine("BorderlessWindowed=" + EngineSettings.BorderlessWindowed);
|
||||
Console.WriteLine("RememberWindowLayout=" + EngineSettings.RememberWindowLayout);
|
||||
Console.WriteLine("PanelLayoutPerCharacter=" + EngineSettings.PanelLayoutPerCharacter);
|
||||
|
|
@ -415,6 +419,7 @@ namespace EngineSettingsTests
|
|||
(new[] { "ilt-add", "Frosthaven" }, "IltServerNames", null),
|
||||
(new[] { "autoid", "all" }, "AutoIdMode", "\"All\""),
|
||||
(new[] { "tgate-off" }, "TransitionGate", "false"),
|
||||
(new[] { "webpanel-off" }, "WebPanel", "false"),
|
||||
(new[] { "add-plugin", plugin }, "PluginPaths", null),
|
||||
(new[] { "remove-plugin", "0" }, "PluginPaths", null),
|
||||
};
|
||||
|
|
@ -622,6 +627,36 @@ namespace EngineSettingsTests
|
|||
}
|
||||
}
|
||||
|
||||
// engine.json WebPanel (2026-11-07, the v93 web panel kill switch): default on, only a hand-set false is
|
||||
// written, other saves keep it, a value that is not a boolean is ignored.
|
||||
private static void WebPanelDefaultOnAndSaved()
|
||||
{
|
||||
string dir = NewDir("webpanel");
|
||||
string path = Path.Combine(dir, "engine.json");
|
||||
|
||||
File.WriteAllText(path, LauncherFile);
|
||||
Eq(DumpValue(RunChild(path, "dump").Out, "WebPanel"), "True", "missing: on");
|
||||
Eq(RunChild(path, "hook-off", "StartTooltip").Exit, 0, "save with the default");
|
||||
Check(!ReadJson(path).TryGetProperty("WebPanel", out _), "the default isn't written to the file");
|
||||
|
||||
var (exit, output) = RunChild(path, "webpanel-off");
|
||||
Eq(exit, 0, "turn off (" + output.Trim() + ")");
|
||||
Eq(ReadJson(path).GetProperty("WebPanel").GetRawText(), "false", "off is saved");
|
||||
Check(ReadJson(path).TryGetProperty("LauncherWindow", out _), "launcher keys kept");
|
||||
Eq(DumpValue(RunChild(path, "dump").Out, "WebPanel"), "False", "off read back at the next start");
|
||||
Eq(RunChild(path, "hook-off", "CheckTooltip").Exit, 0, "another save");
|
||||
Eq(ReadJson(path).GetProperty("WebPanel").GetRawText(), "false", "off survives other saves");
|
||||
|
||||
Eq(RunChild(path, "webpanel-on").Exit, 0, "turn on");
|
||||
Check(!ReadJson(path).TryGetProperty("WebPanel", out _), "on again: dropped from the file");
|
||||
|
||||
foreach (string bad in new[] { "\"no\"", "0", "null" })
|
||||
{
|
||||
File.WriteAllText(path, LauncherFile.Replace("\"LoggingLevel\"", $"\"WebPanel\": {bad}, \"LoggingLevel\""));
|
||||
Eq(DumpValue(RunChild(path, "dump").Out, "WebPanel"), "True", $"{bad}: ignored, on");
|
||||
}
|
||||
}
|
||||
|
||||
// Settings > Display (2026-10-18): BorderlessWindowed off and RememberAcWindowPosition off by default,
|
||||
// RememberWindowLayout on (panels have always been remembered). Only the non-default is written;
|
||||
// other saves keep it; a value that is not a boolean is ignored.
|
||||
|
|
|
|||
Loading…
Reference in a new issue