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
+22
View File
@@ -10,6 +10,7 @@ import {
promoteStatsWindowLevel,
promoteVisibleStatsWindowAboveOverlay,
resolveStatsWindowOuterBoundsForContent,
scheduleStatsWindowPostShowReconciles,
showStatsNativeConfirmDialog,
shouldHideStatsWindowForInput,
STATS_WINDOW_TITLE,
@@ -58,6 +59,25 @@ function syncStatsWindowBounds(
return outerBounds;
}
function reconcileStatsWindowBounds(window: BrowserWindow, options: StatsWindowOptions): void {
if (window.isDestroyed() || !window.isVisible()) {
return;
}
const placementBounds = syncStatsWindowBounds(window, options.resolveBounds());
if (placementBounds) {
ensureHyprlandWindowFloatingByTitle({ title: STATS_WINDOW_TITLE, bounds: placementBounds });
}
}
function scheduleStatsWindowBoundsReconcile(
window: BrowserWindow,
options: StatsWindowOptions,
): void {
scheduleStatsWindowPostShowReconciles(() => {
reconcileStatsWindowBounds(window, options);
});
}
function showStatsWindow(window: BrowserWindow, options: StatsWindowOptions): void {
const bounds = options.resolveBounds();
let placementBounds = syncStatsWindowBounds(window, bounds);
@@ -71,6 +91,8 @@ function showStatsWindow(window: BrowserWindow, options: StatsWindowOptions): vo
}
options.onVisibilityChanged?.(true);
promoteStatsOverlayAbovePlayback();
reconcileStatsWindowBounds(window, options);
scheduleStatsWindowBoundsReconcile(window, options);
}
export function promoteStatsOverlayAbovePlayback(): boolean {