Repository navigation
Window fitting and screenshot: accept negative window coordinates, ignore IceWM's own windows - #10302
Merged
Merged
Conversation
…nore IceWM's own windows A window larger than the 800x600 screen and centered on it has negative absolute coordinates, which xwininfo writes as +-320+-150; the patterns in fit_main_window() and take-screenshot.sh did not match them, so the largest matching window was IceWM's taskbar and the application stayed off screen (#10156, found by HalfSweet). The window manager's own windows are left out of the choice as well. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq
Open
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.
Found by @HalfSweet in #10156 (comment): HSync opens a 1440x900 window centered on the 800x600 Xvfb screen, so
xwininfo -treereports it asThe patterns in
fit_main_window()(worker.sh) and intake-screenshot.shended in[-+][0-9]+[-+][0-9]+$and did not match the+-Nform of negative absolute coordinates. The largest window that did match was IceWM's 800x26 taskbar, so nothing was moved on screen and the screenshot showed the clipped corner.Both patterns now allow an optional minus after each sign (
[-+]-?[0-9]+), and both leave the window manager's own windows ("icewm"class) out of the choice. Checked against the three-line sample (HSync, the taskbar, a normal window):fit_main_windownow picks0x200003 1440 900, andtake-screenshot.shparses1440 900 +-320 +-150, whose existing clipping code already handles negative X and Y.Not in this PR: HSync's minimum window height is 640, more than the 800x600 screen allows, so after the move it is still cut off at the bottom; a taller Xvfb screen (test.yml) would help such applications and is a separate decision, since
check-screenshot.sh's thresholds were calibrated on 800x600 screenshots.🤖 Generated with Claude Code
https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq
Generated by Claude Code