Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

Fix Linux HUD input handling

iRaziul00d635af61c5
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