fix(overlay): Linux X11/XWayland stacking, stale pause state, multi-copy selector (#101)

This commit is contained in:
2026-05-31 20:59:18 -07:00
committed by GitHub
parent b46b8dfa41
commit e1ea464bc9
103 changed files with 6314 additions and 353 deletions
+13 -3
View File
@@ -78,7 +78,9 @@ export function ensureOverlayWindowLevel(window: BrowserWindow): void {
window.moveTop();
return;
}
window.setAlwaysOnTop(true);
// Linux/X11 overlays start managed and only assert topmost while mpv owns the overlay layer.
// Focus loss releases this again so native Wayland apps can cover the overlay on KDE.
window.setAlwaysOnTop(true, 'screen-saver', 1);
window.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
ensureHyprlandWindowFloatingByTitle({ title: window.getTitle() });
window.moveTop();
@@ -106,13 +108,16 @@ export function createOverlayWindow(
isOverlayVisible: (kind: OverlayWindowKind) => boolean;
tryHandleOverlayShortcutLocalFallback: (input: Electron.Input) => boolean;
forwardTabToMpv: () => void;
linuxX11FullscreenOverlay?: boolean;
onVisibleWindowBlurred?: () => void;
onVisibleWindowFocused?: () => void;
onWindowContentReady?: () => void;
onWindowClosed: (kind: OverlayWindowKind) => void;
onWindowClosed: (kind: OverlayWindowKind, window: BrowserWindow) => void;
yomitanSession?: Session | null;
},
): BrowserWindow {
const window = new ElectronBrowserWindow(buildOverlayWindowOptions(kind, options));
window.setSkipTaskbar(true);
(window as BrowserWindow & { [OVERLAY_WINDOW_CONTENT_READY_FLAG]?: boolean })[
OVERLAY_WINDOW_CONTENT_READY_FLAG
] = false;
@@ -172,7 +177,7 @@ export function createOverlayWindow(
window.hide();
window.on('closed', () => {
options.onWindowClosed(kind);
options.onWindowClosed(kind, window);
});
window.on('blur', () => {
@@ -192,6 +197,11 @@ export function createOverlayWindow(
});
});
window.on('focus', () => {
if (window.isDestroyed() || kind !== 'visible') return;
options.onVisibleWindowFocused?.();
});
if (options.isDev && kind === 'visible') {
window.webContents.openDevTools({ mode: 'detach' });
}