WebPanel: stay shown over the game until closed
The panel hid whenever the foreground window left the game process, so a click on another program (and, reportedly, in the game) made it vanish. It now stays shown while the game window is shown and not minimized, and is kept directly above the game in the z-order: over the game, under any window the player brings over the game, so it never covers another program. Closing it (X, Escape, Alt+F4, the plugin, /rc webpanel close) is still the only way it goes away while the game shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7f1e7d5039
commit
dff0172e69
5 changed files with 38 additions and 58 deletions
|
|
@ -110,7 +110,7 @@ internal static unsafe class Program
|
|||
Guard("CreateFailureBrowserFails", () => CheckCreateFailureBrowserFails(s));
|
||||
Guard("NoFocusFromAnotherProcess", () => { int r = CheckNoFocusFromAnotherProcess(s); if (r > 0) handle = r; });
|
||||
Guard("VisibilitySameProcess", () => handle = CheckVisibilitySameProcess(s));
|
||||
Unverified("VisibilityOtherProcess", "needs another process to take the foreground (alt-tab); the harness never forces it. Owner in-game check.");
|
||||
Unverified("VisibilityOtherProcess", "the panel should stay shown, under the other program, while another process holds the foreground (alt-tab); the harness never forces it. Owner in-game check.");
|
||||
Guard("LayoutRemembered", () => handle = CheckLayout(s, lad));
|
||||
Guard("UnloadAfterCloseCollected", () => CheckUnloadAfterClose(ref s, handle));
|
||||
|
||||
|
|
@ -700,8 +700,8 @@ internal static unsafe class Program
|
|||
W($"session 2 open: state [{string.Join(",", State(s, h))}] host visible {visible}");
|
||||
var sd = Stopwatch.StartNew();
|
||||
s.Call("Shutdown", 2000);
|
||||
W($"Shutdown(2000) returned in {sd.ElapsedMilliseconds} ms (panel open; window shown only if the harness held the foreground)");
|
||||
UnloadAndJudge("UnloadWhileVisibleCollected", ref s, visible ? null : "collected, but the panel window was not visible (the PID rule hid it: the harness did not hold the foreground), so the visible-teardown path was not shown");
|
||||
W($"Shutdown(2000) returned in {sd.ElapsedMilliseconds} ms (panel open)");
|
||||
UnloadAndJudge("UnloadWhileVisibleCollected", ref s, visible ? null : "collected, but the panel window was not visible (hidden or not yet shown), so the visible-teardown path was not shown");
|
||||
}
|
||||
|
||||
private static void UnloadAndJudge(string name, ref Session s, string? unverifiedIfCollected = null)
|
||||
|
|
|
|||
|
|
@ -163,16 +163,13 @@ internal static unsafe class Program
|
|||
private static void Visibility()
|
||||
{
|
||||
Case("Visibility");
|
||||
// open, alive, !iconic, visible, !fgNull, fgPid, ourPid
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, true, false, 5, 5), (bool?)true, "same process shows");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, true, false, 6, 5), (bool?)false, "other process hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, true, true, 0, 5), (bool?)null, "null foreground keeps current");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, true, true, false, 5, 5), (bool?)false, "iconic hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(false, true, false, true, false, 5, 5), (bool?)false, "closed hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, false, false, true, false, 5, 5), (bool?)false, "dead game hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, false, false, 5, 5), (bool?)false, "invisible game hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(false, true, false, true, true, 0, 5), (bool?)false, "closed beats null foreground");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, true, true, true, 0, 5), (bool?)false, "iconic beats null foreground");
|
||||
// open, alive, iconic, visible: the foreground window no longer counts (clicking the game or another program keeps it)
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, true), true, "open over a shown game shows");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, true, true), false, "iconic hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(false, true, false, true), false, "closed hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, false, false, true), false, "dead game hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(true, true, false, false), false, "invisible game hides");
|
||||
Eq(WebPanelWindowPolicy.Visible(false, false, true, false), false, "closed beats everything");
|
||||
}
|
||||
|
||||
private static void Layout()
|
||||
|
|
|
|||
Loading…
Reference in a new issue