mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-08 17:16:18 -07:00
fix(overlay): Linux X11/XWayland stacking, stale pause state, multi-copy selector (#101)
This commit is contained in:
@@ -26,18 +26,26 @@ function isYomitanPopupInteractionActive(state: RendererState): boolean {
|
||||
}
|
||||
|
||||
export function syncOverlayMouseIgnoreState(ctx: RendererContext): void {
|
||||
const shouldKeepWindowInteractive =
|
||||
isYomitanPopupInteractionActive(ctx.state) || isBlockingOverlayModalOpen(ctx.state);
|
||||
const shouldStayInteractive =
|
||||
ctx.state.isOverSubtitle ||
|
||||
ctx.state.isOverSubtitleSidebar ||
|
||||
isYomitanPopupInteractionActive(ctx.state) ||
|
||||
isBlockingOverlayModalOpen(ctx.state);
|
||||
ctx.state.isOverSubtitle || ctx.state.isOverSubtitleSidebar || shouldKeepWindowInteractive;
|
||||
const shouldMarkOverlayInteractive = ctx.platform?.isLinuxPlatform
|
||||
? shouldKeepWindowInteractive
|
||||
: shouldStayInteractive;
|
||||
|
||||
if (shouldStayInteractive) {
|
||||
if (shouldMarkOverlayInteractive) {
|
||||
ctx.dom.overlay.classList.add('interactive');
|
||||
} else {
|
||||
ctx.dom.overlay.classList.remove('interactive');
|
||||
}
|
||||
if (!ctx.platform?.shouldToggleMouseIgnore) {
|
||||
// On Linux the main process owns window passthrough via a cursor poll (Electron can't
|
||||
// forward mouse-move through a click-through window on X11). Report the interactive hint
|
||||
// only for popups/modals that sit off measured hit rects; subtitles/sidebar use the poll.
|
||||
if (ctx.platform?.isLinuxPlatform) {
|
||||
window.electronAPI.reportOverlayInteractive?.(shouldKeepWindowInteractive);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user