From 168d230c91c9571ecc025ecc57e2bdcc77e2c07c Mon Sep 17 00:00:00 2001 From: iRaziul Date: Thu, 2 Apr 2026 17:40:27 +0600 Subject: [PATCH] Fix Linux HUD input handling --- electron/windows.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/electron/windows.ts b/electron/windows.ts index 1c027ed7..1abb70e3 100644 --- a/electron/windows.ts +++ b/electron/windows.ts @@ -45,6 +45,10 @@ function isHudOverlayCaptureProtectionSupported(): boolean { return process.platform !== "linux"; } +function isHudOverlayMousePassthroughSupported(): boolean { + return process.platform !== "linux"; +} + function loadHudOverlayCaptureProtectionSetting(): boolean { if (hudOverlayCaptureProtectionLoaded) { return hudOverlayHiddenFromCapture; @@ -174,11 +178,17 @@ function positionUpdateToastWindow() { ipcMain.on("hud-overlay-set-ignore-mouse", (_event, ignore: boolean) => { if (hudOverlayWindow && !hudOverlayWindow.isDestroyed()) { + if (!isHudOverlayMousePassthroughSupported()) { + hudOverlayWindow.setIgnoreMouseEvents(false); + return; + } + if (ignore) { hudOverlayWindow.setIgnoreMouseEvents(true, { forward: true }); - } else { - hudOverlayWindow.setIgnoreMouseEvents(false); + return; } + + hudOverlayWindow.setIgnoreMouseEvents(false); } }); @@ -320,7 +330,9 @@ export function createHudOverlayWindow(): BrowserWindow { win.setContentProtection(hudOverlayHiddenFromCapture); } - win.setIgnoreMouseEvents(true, { forward: true }); + if (isHudOverlayMousePassthroughSupported()) { + win.setIgnoreMouseEvents(true, { forward: true }); + } // On Windows 10, focus changes (e.g. showing a native notification) can break // setIgnoreMouseEvents forwarding on a transparent always-on-top window, making