upgrade Electron 39→42 and fix Hyprland overlay z-order/placement (#79)

This commit is contained in:
2026-05-22 23:22:51 -07:00
committed by GitHub
parent c6328eef09
commit c4f99fec2f
30 changed files with 557 additions and 126 deletions
@@ -0,0 +1,56 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { createStatsOverlayVisibilityChangeHandler } from './stats-overlay-visibility';
test('stats overlay visibility handler makes overlay mouse-passive before opening stats', () => {
const calls: string[] = [];
const handler = createStatsOverlayVisibilityChangeHandler({
setStatsOverlayVisibleState: (visible) => calls.push(`state:${visible}`),
resetVisibleOverlayInteraction: () => calls.push('reset-interaction'),
getMainWindow: () =>
({
isDestroyed: () => false,
isVisible: () => true,
setIgnoreMouseEvents: (ignore: boolean, options?: { forward?: boolean }) => {
calls.push(`mouse-ignore:${ignore}:${options?.forward === true ? 'forward' : 'plain'}`);
},
}) as never,
updateVisibleOverlayVisibility: () => calls.push('update-visible'),
});
handler(true);
assert.deepEqual(calls, [
'state:true',
'reset-interaction',
'mouse-ignore:true:forward',
'update-visible',
]);
});
test('stats overlay visibility handler restores overlay then leaves mpv mouse-responsive after close', () => {
const calls: string[] = [];
const handler = createStatsOverlayVisibilityChangeHandler({
setStatsOverlayVisibleState: (visible) => calls.push(`state:${visible}`),
resetVisibleOverlayInteraction: () => calls.push('reset-interaction'),
getMainWindow: () =>
({
isDestroyed: () => false,
isVisible: () => true,
setIgnoreMouseEvents: (ignore: boolean, options?: { forward?: boolean }) => {
calls.push(`mouse-ignore:${ignore}:${options?.forward === true ? 'forward' : 'plain'}`);
},
}) as never,
updateVisibleOverlayVisibility: () => calls.push('update-visible'),
});
handler(false);
assert.deepEqual(calls, [
'state:false',
'reset-interaction',
'update-visible',
'mouse-ignore:true:forward',
]);
});