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:
Daniel Wallace 2026-11-13 12:32:59 -08:00
commit dff0172e69
5 changed files with 38 additions and 58 deletions

View file

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