Repository navigation
Conversation
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.
Problem and fix
On Windows, covering a target window with another application can make
get_app_statereturn the covering application's pixels: capture currently crops a desktop rectangle. Coordinate clicks are also posted to the top-level HWND, so a nested control may receive no mouse messages even though the tool reports success.Capture the selected HWND with
PrintWindow(PW_RENDERFULLCONTENT)and retain full-window physical-pixel coordinates. Validate geometry before and after capture and omit the image when capture fails. Resolve posted clicks within the target's native child hierarchy, convert to child-local coordinates, and check enabled state, process ownership, current window/element geometry and message delivery. Attempt mouse release when down delivery fails or is interrupted. UI Automation-first actions and the global input opt-in are preserved.Add a disposable fixture, native MCP regression, production-function fault tests and Windows CI coverage. Correct the existing observation harness for PowerShell 5.1 array/UTF-8 behavior and localized UIA role names. Update documentation, history and release notes; no version bump is included.
Validation
auto; right-click and panel counters; refusal of disabled controls, invalid points and stale window/element geometry; minimized-image omission.make check-docsandgit diff --checkpassed locally. No GitHub CI result is claimed for this local candidate.Reproduce from the repository root on an interactive Windows desktop: build the Windows executable, then run
scripts/tests/windows-target-smoke.ps1 -NativePath <executable>. Use v1.1.3 with-ExpectOriginalto reproduce the original defects. Add-EvidencePath <output.png>to save the fixture-only crop. Full commands and coverage are documented indocs/windows-targeting.md.Both panels are actual native MCP captures from the same fixture setup. Identical client-area crops exclude window chrome and desktop edge pixels; captured content is unaltered. The image demonstrates capture behavior; fixture counters separately verify click delivery and acceptance by a standard button.
Scope
These are capture-source and input-target defects, not defects specific to 200% scaling. Native validation here covers the tested WinForms and WPF fixtures at 200%; 100%, 150%, mixed-DPI monitor transitions and other toolkits were not independently tested.
PrintWindowdepends on the renderer and may return blank or incomplete content for unsupported surfaces. SuccessfulPostMessagedelivery proves that messages were queued, not that every custom or owner-drawn control accepted the action. Foreground/cursor readings are diagnostic observations; they do not guarantee that arbitrary applications cannot change focus.The fix does not silently activate the target or move the physical pointer as a workaround. macOS and Linux runtimes are unchanged.