mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-11 04:19:26 -07:00
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:
@@ -384,6 +384,21 @@ export function ensureWindowsOverlayTransparencyNative(overlayHwnd: number): boo
|
||||
}
|
||||
}
|
||||
|
||||
export function bindWindowsOverlayAboveMpvNative(overlayHwnd: number): boolean {
|
||||
try {
|
||||
const win32 = require('./win32') as typeof import('./win32');
|
||||
const poll = win32.findMpvWindows();
|
||||
const focused = poll.matches.find((m) => m.isForeground);
|
||||
const best = focused ?? poll.matches.sort((a, b) => b.area - a.area)[0];
|
||||
if (!best) return false;
|
||||
win32.bindOverlayAboveMpv(overlayHwnd, best.hwnd);
|
||||
win32.ensureOverlayTransparency(overlayHwnd);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function clearWindowsOverlayOwnerNative(overlayHwnd: number): boolean {
|
||||
try {
|
||||
const win32 = require('./win32') as typeof import('./win32');
|
||||
|
||||
Reference in New Issue
Block a user