Repository navigation
fix: capture a window's visible frame, not its invisible border - #156
Merged
Merged
Conversation
GetWindowRect includes the ~8 px invisible resize border on Windows 10/11, so window: captures showed a strip of whatever was behind the window. Use DWMWA_EXTENDED_FRAME_BOUNDS, falling back to GetWindowRect. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
`window:<title>` bounds came from `GetWindowRect`, which on Windows 10/11 includes the invisible resize border (about 8 px a side). Every window capture was edged with a strip of whatever sat behind the window: other apps, the desktop. That is a privacy problem for a tool whose output gets shared. Found while making example media for the #129 cookbook.
Bounds now come from `DwmGetWindowAttribute(DWMWA_EXTENDED_FRAME_BOUNDS)`, the visible frame, falling back to `GetWindowRect` if DWM fails. The process is already per-monitor DPI aware, so these are physical pixels, matching gdigrab.
Test: the live harness opens a form with a 500 px client area and checks the capture is 500–504 px wide. It captured 516 before this change and 502 after. Bumps to 0.27.2.
🤖 Generated with Claude Code