-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(hud): stop the recording overlay from swallowing clicks #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import { app, BrowserWindow, ipcMain } from "electron"; | |
| import { USER_DATA_PATH } from "./appPaths"; | ||
| import { | ||
| getHudOverlayWindowBounds, | ||
| recordingForcesHudOverlayFallback, | ||
| resizeHudOverlayFallbackBounds, | ||
| shouldExpandHudOverlayFallback, | ||
| } from "./hudOverlayBounds"; | ||
|
|
@@ -193,6 +194,13 @@ function getHudOverlayDisplay() { | |
| return getScreen().getPrimaryDisplay(); | ||
| } | ||
|
|
||
| function recordingForcesHudFallback(): boolean { | ||
| return recordingForcesHudOverlayFallback({ | ||
| platform: process.platform, | ||
| recordingActive: hudOverlayRecordingActive, | ||
| }); | ||
| } | ||
|
|
||
| function getHudOverlayBounds() { | ||
| const { workArea } = getHudOverlayDisplay(); | ||
| const fallbackExpanded = shouldExpandHudOverlayFallback({ | ||
|
|
@@ -202,7 +210,7 @@ function getHudOverlayBounds() { | |
| }); | ||
| return getHudOverlayWindowBounds( | ||
| workArea, | ||
| isHudOverlayMousePassthroughSupported() && !hudOverlayRecordingActive, | ||
| isHudOverlayMousePassthroughSupported() && !recordingForcesHudFallback(), | ||
| fallbackExpanded, | ||
| ); | ||
| } | ||
|
|
@@ -259,7 +267,7 @@ function positionUpdateToastWindow() { | |
| } | ||
|
|
||
| function setHudOverlayFallbackExpanded(expanded: boolean) { | ||
| if (hudOverlayRecordingActive) { | ||
| if (recordingForcesHudFallback()) { | ||
| hudOverlayFallbackExpanded = false; | ||
| return; | ||
| } | ||
|
|
@@ -290,7 +298,7 @@ function setHudOverlayMousePassthrough(ignore: boolean) { | |
| hudOverlayIgnoringMouse = | ||
| hudOverlaySourceSelectionActive && !hudOverlayRecordingActive | ||
| ? true | ||
| : hudOverlayRecordingActive | ||
| : recordingForcesHudFallback() | ||
| ? false | ||
| : ignore; | ||
|
|
||
|
|
@@ -303,7 +311,7 @@ function setHudOverlayMousePassthrough(ignore: boolean) { | |
| return; | ||
| } | ||
|
|
||
| if (hudOverlayRecordingActive) { | ||
| if (recordingForcesHudFallback()) { | ||
| hudOverlayFallbackExpanded = false; | ||
| applyHudOverlayBounds(); | ||
| hudOverlayWindow.setIgnoreMouseEvents(false); | ||
|
Comment on lines
+314
to
317
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Force compact bounds when the Windows fallback is active. Setting Override expansion when Proposed fix function getHudOverlayBounds() {
const { workArea } = getHudOverlayDisplay();
- const fallbackExpanded = shouldExpandHudOverlayFallback({
- fallbackExpanded: hudOverlayFallbackExpanded,
- recordingActive: hudOverlayRecordingActive,
- webcamPreviewVisible: hudOverlayWebcamPreviewVisible,
- });
+ const fallbackExpanded = recordingForcesHudFallback()
+ ? false
+ : shouldExpandHudOverlayFallback({
+ fallbackExpanded: hudOverlayFallbackExpanded,
+ recordingActive: hudOverlayRecordingActive,
+ webcamPreviewVisible: hudOverlayWebcamPreviewVisible,
+ });Also applies to: 669-677 🤖 Prompt for AI Agents |
||
|
|
@@ -503,7 +511,7 @@ export function createHudOverlayWindow(): BrowserWindow { | |
| } | ||
|
|
||
| if (isHudOverlayMousePassthroughSupported()) { | ||
| if (hudOverlayRecordingActive) { | ||
| if (recordingForcesHudFallback()) { | ||
| hudOverlayIgnoringMouse = false; | ||
| win.setIgnoreMouseEvents(false); | ||
| } else { | ||
|
|
@@ -638,7 +646,7 @@ export function reassertHudOverlayMousePassthrough(): void { | |
| return; | ||
| } | ||
|
|
||
| if (hudOverlayRecordingActive) { | ||
| if (recordingForcesHudFallback()) { | ||
| hud.setIgnoreMouseEvents(false); | ||
| return; | ||
| } | ||
|
|
@@ -658,10 +666,31 @@ export function reassertHudOverlayMousePassthrough(): void { | |
| } | ||
|
|
||
| export function setHudOverlayRecordingActive(recording: boolean): void { | ||
| const wasFallbackForced = recordingForcesHudFallback(); | ||
| hudOverlayRecordingActive = Boolean(recording); | ||
| hudOverlayFallbackExpanded = false; | ||
| applyHudOverlayBounds(); | ||
| setHudOverlayMousePassthrough(!hudOverlayRecordingActive); | ||
|
|
||
| if (recordingForcesHudFallback()) { | ||
| // Compact, always-interactive HUD window: the whole window is the bar. | ||
| setHudOverlayMousePassthrough(false); | ||
| return; | ||
| } | ||
|
|
||
| if (wasFallbackForced) { | ||
| // Leaving the compact fallback re-expands the overlay to the whole work | ||
| // area, so it has to become click-through again before it swallows every | ||
| // click on the desktop. | ||
| setHudOverlayMousePassthrough(true); | ||
| return; | ||
| } | ||
|
|
||
| // The overlay already spans the work area and stays click-through while | ||
| // recording; the renderer's hover tracking owns the interactive state, so | ||
| // preserve it instead of forcing the window interactive (which would block | ||
| // clicks everywhere) or click-through (which would drop a click already | ||
| // aimed at the bar). | ||
| setHudOverlayMousePassthrough(hudOverlayIgnoringMouse); | ||
| } | ||
|
|
||
| export function createUpdateToastWindow(): BrowserWindow { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Keep the full-work-area overlay on Linux.
isHudOverlayMousePassthroughSupported()returnsfalseon Linux. Line 213 therefore always selects compact fallback bounds on Linux.recordingForcesHudFallback()returningfalsecannot preserve the full-work-area overlay.Implement a Linux full-work-area click-through path, or remove Linux from this fallback contract and the PR objective.
🤖 Prompt for AI Agents