fix(overlay): keep Yomitan popup interactive on macOS/Windows (#177)

This commit is contained in:
2026-07-30 19:47:08 -07:00
committed by GitHub
parent 1995200e76
commit 89ed675935
5 changed files with 39 additions and 74 deletions
@@ -270,7 +270,16 @@ export function resolveDesiredOverlayInteractive(
);
}
export function tickLinuxOverlayPointerInteraction(deps: LinuxOverlayPointerInteractionDeps): void {
export function tickLinuxOverlayPointerInteraction(
deps: LinuxOverlayPointerInteractionDeps,
platform: NodeJS.Platform = process.platform,
): void {
// Linux-only. Windows/macOS drive interaction state from renderer hover (setIgnoreMouseEvents),
// which knows about Yomitan popups and modals that sit off the measured subtitle rects. This
// cursor poll only hit-tests those rects, so running it elsewhere would clear interaction state
// (and re-enable window passthrough) whenever a measurement lands while the pointer is on a
// popup, swallowing popup clicks and scroll.
if (platform !== 'linux') return;
if (deps.shouldUseInputShape?.()) return;
const desired = resolveDesiredOverlayInteractive(deps);
if (desired === null) return;