mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-06-13 15:13:32 -07:00
fix(overlay): correct Hyprland fullscreen overlay alignment on Linux (#107)
This commit is contained in:
@@ -8,6 +8,7 @@ import type { WindowGeometry } from '../../types';
|
||||
const DEFAULT_STATS_WINDOW_WIDTH = 900;
|
||||
const DEFAULT_STATS_WINDOW_HEIGHT = 700;
|
||||
export const STATS_WINDOW_TITLE = 'SubMiner Stats';
|
||||
const STATS_POST_SHOW_RECONCILE_DELAYS_MS = [50, 150, 300, 600] as const;
|
||||
|
||||
type StatsWindowLevelController = Pick<BrowserWindow, 'setAlwaysOnTop' | 'moveTop'> &
|
||||
Partial<Pick<BrowserWindow, 'setVisibleOnAllWorkspaces' | 'setFullScreenable'>>;
|
||||
@@ -26,6 +27,14 @@ type StatsNativeConfirmDialogPresenter<WindowT> = {
|
||||
type StatsWindowBoundsController = Pick<BrowserWindow, 'getBounds' | 'getContentBounds'>;
|
||||
type StatsWindowPresentationController = Pick<BrowserWindow, 'show' | 'focus'> &
|
||||
Partial<Pick<BrowserWindow, 'showInactive'>>;
|
||||
type StatsWindowReconcileScheduler = {
|
||||
setTimeout: (
|
||||
callback: () => void,
|
||||
delayMs: number,
|
||||
) => {
|
||||
unref?: () => void;
|
||||
};
|
||||
};
|
||||
|
||||
function isBareToggleKeyInput(input: Electron.Input, toggleKey: string): boolean {
|
||||
return (
|
||||
@@ -189,6 +198,16 @@ export function presentStatsWindow(
|
||||
window.focus();
|
||||
}
|
||||
|
||||
export function scheduleStatsWindowPostShowReconciles(
|
||||
reconcile: () => void,
|
||||
scheduler: StatsWindowReconcileScheduler = globalThis,
|
||||
): void {
|
||||
for (const delayMs of STATS_POST_SHOW_RECONCILE_DELAYS_MS) {
|
||||
const timeout = scheduler.setTimeout(reconcile, delayMs);
|
||||
timeout.unref?.();
|
||||
}
|
||||
}
|
||||
|
||||
export function buildStatsWindowLoadFileOptions(apiBaseUrl?: string): {
|
||||
query: Record<string, string>;
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user