mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
fix(jellyfin): fix overlay toggle sync, redirect reload, and AppImage bi
- Sync visible-overlay state back to plugin via script messages to avoid toggle/hide drift - Collapse duplicate toggle events within 250ms to prevent hide-then-show on single keypress - Preserve manual hide across Jellyfin path-changing redirects even when media-title drops - Rearm managed subtitle defaults on path-changing redirects - Route toggleVisibleOverlay session binding through plugin toggle instead of app-side IPC - Show Linux/Hyprland overlay passively (showInactive) to avoid stealing mpv keyboard focus - Fix AppImage binary resolution to prefer $APPIMAGE env over mounted inner binary - Add stats window layer management so delete/update dialogs appear above stats window - Fix Jellyfin remote progress sync during Linux websocket reconnect windows
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import type { BrowserWindow, BrowserWindowConstructorOptions } from 'electron';
|
||||
import type {
|
||||
BrowserWindow,
|
||||
BrowserWindowConstructorOptions,
|
||||
MessageBoxSyncOptions,
|
||||
} from 'electron';
|
||||
import type { WindowGeometry } from '../../types';
|
||||
|
||||
const DEFAULT_STATS_WINDOW_WIDTH = 900;
|
||||
@@ -9,6 +13,15 @@ type StatsWindowLevelController = Pick<BrowserWindow, 'setAlwaysOnTop' | 'moveTo
|
||||
Partial<Pick<BrowserWindow, 'setVisibleOnAllWorkspaces' | 'setFullScreenable'>>;
|
||||
type VisibleStatsWindowLevelController = StatsWindowLevelController &
|
||||
Pick<BrowserWindow, 'isDestroyed' | 'isVisible'>;
|
||||
type VisibleStatsWindowDialogLayerController = Pick<
|
||||
BrowserWindow,
|
||||
'isDestroyed' | 'isVisible' | 'setAlwaysOnTop'
|
||||
>;
|
||||
type StatsNativeConfirmDialogWindow = Pick<BrowserWindow, 'isDestroyed'>;
|
||||
type StatsNativeConfirmDialogPresenter<WindowT> = {
|
||||
showWithParent: (window: WindowT, options: MessageBoxSyncOptions) => number;
|
||||
showWithoutParent: (options: MessageBoxSyncOptions) => number;
|
||||
};
|
||||
|
||||
type StatsWindowBoundsController = Pick<BrowserWindow, 'getBounds' | 'getContentBounds'>;
|
||||
type StatsWindowPresentationController = Pick<BrowserWindow, 'show' | 'focus'> &
|
||||
@@ -124,6 +137,41 @@ export function promoteVisibleStatsWindowAboveOverlay(
|
||||
return true;
|
||||
}
|
||||
|
||||
export function demoteVisibleStatsWindowBelowDialogs(
|
||||
window: VisibleStatsWindowDialogLayerController,
|
||||
): boolean {
|
||||
if (window.isDestroyed() || !window.isVisible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
window.setAlwaysOnTop(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
export function buildStatsNativeConfirmDialogOptions(message: string): MessageBoxSyncOptions {
|
||||
return {
|
||||
type: 'warning',
|
||||
message,
|
||||
buttons: ['Delete', 'Cancel'],
|
||||
defaultId: 1,
|
||||
cancelId: 1,
|
||||
noLink: true,
|
||||
};
|
||||
}
|
||||
|
||||
export function showStatsNativeConfirmDialog<WindowT extends StatsNativeConfirmDialogWindow>(
|
||||
window: WindowT | null,
|
||||
message: string,
|
||||
presenter: StatsNativeConfirmDialogPresenter<WindowT>,
|
||||
): boolean {
|
||||
const options = buildStatsNativeConfirmDialogOptions(message);
|
||||
const response =
|
||||
window && !window.isDestroyed()
|
||||
? presenter.showWithParent(window, options)
|
||||
: presenter.showWithoutParent(options);
|
||||
return response === 0;
|
||||
}
|
||||
|
||||
export function presentStatsWindow(
|
||||
window: StatsWindowPresentationController,
|
||||
platform: NodeJS.Platform = process.platform,
|
||||
|
||||
Reference in New Issue
Block a user