fix: prewarmed overlay blocking clicks by ignoring cursor events when…#1523
Conversation
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
I added a few extra things sorry! Thanks for the PR |
| .await | ||
| .map_err(|e| format!("Failed to capture screenshot: {e}"))?; | ||
|
|
||
| AppSounds::Notification.play(); |
There was a problem hiding this comment.
Screenshot uses wrong sound variant
Low Severity
The new AppSounds::Screenshot enum variant is added with a dedicated screenshot.ogg sound file, but the screenshot capture code at line 1208 calls AppSounds::Notification.play() instead of AppSounds::Screenshot.play(). This means screenshots play the generic notification sound (action.ogg) rather than the intended dedicated screenshot sound.
Problem
The prewarmed target-select-overlay windows introduced in v0.4.4 (commit 0f456b1) block all click events on the main window, making the app completely unusable after startup.
Discovered on: macOS (Apple Silicon/ARM)
Root Cause
Prewarmed overlay windows are created at startup and hidden for faster display, but they still intercept mouse events even when invisible, as they cover the entire screen.
Solution
ignore_cursor_events(true)when creating prewarmed windows to let clicks pass throughignore_cursor_events(false)when showing the window to enable interactionTesting
Tested on: macOS (Apple Silicon)
Changes
Modified
apps/desktop/src-tauri/src/target_select_overlay.rs:set_ignore_cursor_events(true)inprewarm_target_select_overlays()after window creationset_ignore_cursor_events(false)inopen_target_select_overlays()before showing windowGreptile Summary
Fixed a critical bug introduced in v0.4.4 where prewarmed overlay windows blocked all mouse interactions with the main window on macOS. The fix adds
set_ignore_cursor_events(true)when creating prewarmed windows and restoresset_ignore_cursor_events(false)when displaying them.Key changes:
prewarm_target_select_overlays: Setignore_cursor_events(true)after creating hidden overlay windowsopen_target_select_overlays: Setignore_cursor_events(false)before showing the prewarmed windowThe implementation correctly handles the window lifecycle and maintains the prewarming optimization while ensuring mouse events pass through when windows are hidden.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant App as Desktop App participant Prewarm as prewarm_target_select_overlays participant Store as PrewarmedOverlays participant Window as Overlay Window participant Open as open_target_select_overlays participant User as User Interaction Note over App,Store: App Startup Phase App->>Prewarm: Call prewarm function loop For each display Prewarm->>Window: Create overlay window (hidden) Window-->>Prewarm: Window created Prewarm->>Window: set_ignore_cursor_events(true) Note over Window: Window ignores all mouse events Prewarm->>Store: Store prewarmed window end Note over App,User: User Triggers Recording User->>Open: Activate target selection Open->>Store: take(display_id) Store-->>Open: Return prewarmed window Open->>Window: set_ignore_cursor_events(false) Note over Window: Window now accepts mouse events Open->>Window: show() and set_focus() Window-->>User: Overlay visible and interactiveNote
Overlay and screenshot UX
TargetSelectOverlaywindows withhide()andset_ignore_cursor_events(true); restore withset_ignore_cursor_events(false)when showntake_screenshotto prevent interference; small delay to ensure state settlesAppSounds::Screenshotand suppress notification sounds for screenshot-related toasts; play a sound at capture timeTarget Selectwindow inwindows.rsEncoding, timing, and rendering stability
writer_failed; check writer status inappend_sample_buf; early-fail queueing after writer errorsAudioDriftTrackerwith wall-clock clamping to correct drift; tighter audio wall-clock toleranceget_frame_initial) and increased decode retries with backoffWritten by Cursor Bugbot for commit d056e4a. This will update automatically on new commits. Configure here.