mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-27 12:55:20 -07:00
upgrade Electron 39→42 and fix Hyprland overlay z-order/placement (#79)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
type StatsOverlayVisibilityWindow = {
|
||||
isDestroyed: () => boolean;
|
||||
isVisible: () => boolean;
|
||||
setIgnoreMouseEvents: (ignore: boolean, options?: { forward?: boolean }) => void;
|
||||
};
|
||||
|
||||
function makeOverlayMousePassive(window: StatsOverlayVisibilityWindow | null): void {
|
||||
if (!window || window.isDestroyed() || !window.isVisible()) {
|
||||
return;
|
||||
}
|
||||
window.setIgnoreMouseEvents(true, { forward: true });
|
||||
}
|
||||
|
||||
export function createStatsOverlayVisibilityChangeHandler(deps: {
|
||||
setStatsOverlayVisibleState: (visible: boolean) => void;
|
||||
resetVisibleOverlayInteraction: () => void;
|
||||
getMainWindow: () => StatsOverlayVisibilityWindow | null;
|
||||
updateVisibleOverlayVisibility: () => void;
|
||||
}) {
|
||||
return (visible: boolean): void => {
|
||||
deps.setStatsOverlayVisibleState(visible);
|
||||
deps.resetVisibleOverlayInteraction();
|
||||
|
||||
if (visible) {
|
||||
makeOverlayMousePassive(deps.getMainWindow());
|
||||
deps.updateVisibleOverlayVisibility();
|
||||
return;
|
||||
}
|
||||
|
||||
deps.updateVisibleOverlayVisibility();
|
||||
makeOverlayMousePassive(deps.getMainWindow());
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user