Skip to content

Window fitting and screenshot: accept negative window coordinates, ignore IceWM's own windows - #10302

Merged
probonopd merged 1 commit into
masterfrom
claude/window-coords
Oct 16, 2026
Merged

probonopd merged 1 commit into
masterfrom
claude/window-coords

Conversation

@probonopd

Copy link
Copy Markdown
Member

Found by @HalfSweet in #10156 (comment): HSync opens a 1440x900 window centered on the 800x600 Xvfb screen, so xwininfo -tree reports it as

0x200003 "HSync": ("hsync" "Hsync")  1440x900+-320+-150  +-320+-150

The patterns in fit_main_window() (worker.sh) and in take-screenshot.sh ended in [-+][0-9]+[-+][0-9]+$ and did not match the +-N form 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_window now picks 0x200003 1440 900, and take-screenshot.sh parses 1440 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

…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
@probonopd probonopd mentioned this pull request Oct 16, 2026
@probonopd
probonopd merged commit bba6b29 into master Oct 16, 2026
1 check passed
@probonopd
probonopd deleted the claude/window-coords branch October 16, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant