fix(windows): fix capture area sizing on HiDPI monitors and clean up …#1953
Open
ManthanNimodiya wants to merge 3 commits into
Open
fix(windows): fix capture area sizing on HiDPI monitors and clean up …#1953ManthanNimodiya wants to merge 3 commits into
ManthanNimodiya wants to merge 3 commits into
Conversation
…target-select overlay on recording start/stop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses three Windows multi-monitor issues reported in Discord:
1. Capture area shows only half the selected region on secondary monitors
CaptureAreaon Windows was passing physical pixel bounds toinner_size()/position()which expect logical (DPI-scaled) coordinates. On a 150% DPI monitor this makes the window 1.5× too large and mispositioned. Fixed to use the same post-build resize pattern already used forTargetSelectOverlay: build at 100×100, then set logical size + physical position.2. Ghost transparent overlay appears after every recording
When recording starts,
TargetSelectOverlaywindows were hidden viahide_overlay()but theWindowFocusManagermonitoring task was left running. Fixed to also callfm.destroy()for each overlay when recording starts, matching the behaviour ofclose_target_select_overlays.3. Overlay lingers and can reappear when main window comes back
Added an explicit overlay teardown at recording end (
handle_recording_end) to guarantee any previously hidden overlays are cleaned up before the main window is restored, preventing them from being re-shown by subsequentopen_target_select_overlayscalls.Greptile Summary
This PR updates Windows recording overlay behavior. The main changes are:
Confidence Score: 4/5
The Windows capture-area path can panic or keep the stub window when display geometry or post-build resizing fails.
apps/desktop/src-tauri/src/windows.rs
Important Files Changed
Comments Outside Diff (3)
apps/desktop/src-tauri/src/windows.rs, line 2254-2256 (link)When a selected Windows monitor is unplugged, disconnected by RDP, or otherwise changes between
Display::from_id(screen_id)and this resize block, these geometry calls can returnNone. The previous code skipped sizing whenphysical_bounds()was unavailable, but this path now panics and can leave the capture window at the 100x100 stub on the primary display.Prompt To Fix With AI
apps/desktop/src-tauri/src/windows.rs, line 2261-2262 (link)The window is first created at
(0, 0)with a 100x100 size, then these fallible post-build calls are the only operations that move it onto the selected monitor and resize it. If Windows or WebView rejects either call during a DPI or monitor transition, the error is discarded and recording can continue with the capture area still on the primary display or at the stub size.Prompt To Fix With AI
apps/desktop/src-tauri/src/windows.rs, line 2266-2271 (link)This retry only checks the physical width after applying the logical size. On portrait monitors, fractional DPI rounding, or delayed window-manager updates where only the height is wrong, the capture area is accepted with an incorrect vertical size and can clip or overextend the selected region.
Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/windows-mul..." | Re-trigger Greptile
Context used: