Fix Windows overlay z-order on minimize/restore and improve hover stability

Use native synchronous z-order binding (koffi) instead of async PowerShell
for overlay positioning, eliminating the 200-500ms delay that left the overlay
behind mpv after restore. Hide the overlay immediately when mpv is minimized
so the full show/reveal/z-order flow triggers cleanly on restore.

Also adds hover suppression after visibility recovery and window resize to
prevent spurious auto-pause, Windows secondary subtitle titlebar fix, and
z-order sync burst retries on geometry changes.
This commit is contained in:
2026-04-10 01:55:09 -07:00
committed by sudacode
parent 19e210c3a0
commit 59f30effc4
12 changed files with 333 additions and 10 deletions

View File

@@ -242,6 +242,7 @@ test('Windows visible overlay stays click-through and binds to mpv while tracked
test('Windows visible overlay restores opacity after the deferred reveal delay', async () => {
const { window, calls, getOpacity } = createMainWindowRecorder();
let syncWindowsZOrderCalls = 0;
const tracker: WindowTrackerStub = {
isTracking: () => true,
getGeometry: () => ({ x: 0, y: 0, width: 1280, height: 720 }),
@@ -260,6 +261,7 @@ test('Windows visible overlay restores opacity after the deferred reveal delay',
calls.push('ensure-level');
},
syncWindowsOverlayToMpvZOrder: () => {
syncWindowsZOrderCalls += 1;
calls.push('sync-windows-z-order');
},
syncPrimaryOverlayWindowLayer: () => {
@@ -276,8 +278,10 @@ test('Windows visible overlay restores opacity after the deferred reveal delay',
} as never);
assert.equal(getOpacity(), 0);
assert.equal(syncWindowsZOrderCalls, 1);
await new Promise<void>((resolve) => setTimeout(resolve, 60));
assert.equal(getOpacity(), 1);
assert.equal(syncWindowsZOrderCalls, 2);
assert.ok(calls.includes('opacity:1'));
});