Fix launcher overlay startup gating and socket alignment

- only start overlay from launcher when --start is passed or plugin auto_start is enabled

- read socket_path from mpv script-opts/subminer.conf and use it for mpv/overlay/subtitle IPC

- only stop overlay on launcher cleanup when launcher actually started it

- preserve --start semantics for second-instance command+action flows so MPV reconnect happens before toggles
This commit is contained in:
2026-02-12 00:45:15 -08:00
parent b8d9873f14
commit 185915628d
3 changed files with 147 additions and 32 deletions

View File

@@ -255,7 +255,7 @@ test("handleCliCommandService still runs non-start actions on second-instance",
deps,
);
assert.ok(calls.includes("toggleVisibleOverlay"));
assert.equal(calls.some((value) => value === "connectMpvClient"), false);
assert.equal(calls.some((value) => value === "connectMpvClient"), true);
});
test("handleCliCommandService handles visibility and utility command dispatches", () => {

View File

@@ -215,19 +215,18 @@ export function handleCliCommandService(
args.openRuntimeOptions ||
args.texthooker ||
args.help;
const ignoreStart = source === "second-instance" && args.start;
if (ignoreStart && !hasNonStartAction) {
const ignoreStartOnly = source === "second-instance" && args.start && !hasNonStartAction;
if (ignoreStartOnly) {
deps.log("Ignoring --start because SubMiner is already running.");
return;
}
const shouldStart =
!ignoreStart &&
(args.start ||
(source === "initial" &&
(args.toggle ||
args.toggleVisibleOverlay ||
args.toggleInvisibleOverlay)));
args.start ||
(source === "initial" &&
(args.toggle ||
args.toggleVisibleOverlay ||
args.toggleInvisibleOverlay));
const needsOverlayRuntime = commandNeedsOverlayRuntime(args);
if (args.socketPath !== undefined) {