mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-11 04:46:07 -08:00
upgrade Electron 39→42 and fix Hyprland overlay z-order/placement (#79)
This commit is contained in:
1 parent
c6328eef09
commit
c4f99fec2f
30 files changed
+557
-126
No files matched your search
@@ -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',
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user