fix(overlay): correct Hyprland fullscreen overlay alignment on Linux (#107)

This commit is contained in:
2026-06-01 02:12:16 -07:00
committed by GitHub
parent f1e260e996
commit 76f99e6518
15 changed files with 501 additions and 23 deletions
+19
View File
@@ -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>;
} {