Skip to content

fix(screenshot): keep last region in logical coordinates - #4070

Merged
bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:fix/screenshot-last-geometry
Nov 2, 2026
Merged

bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:fix/screenshot-last-geometry

Conversation

@hthienloc

Copy link
Copy Markdown
Member

dms screenshot last failed on scaled displays because the saved region was treated as device pixels and scaled again during capture. Store selected and scroll regions in logical coordinates, and preserve those coordinates for geometry output and protocol-based capture. Keep Mango's device-pixel handling.

@github-actions github-actions Bot added the core Go daemon and CLI under core/ label Nov 1, 2026
@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

Comment thread core/internal/screenshot/screenshot.go Resolved
@claude

claude Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Claude review

The last-region fix is right for capture and geometry, but the region selector's pre-selection still reads the saved region as device pixels, so it breaks on scaled outputs.

  • Pre-selection of the saved region shrinks by the output scale: applyPreSelection still converts from device pixels, core/internal/screenshot/region_input.go:894
  • --json now reports scale: 1 for region and window captures on non-Mango compositors, even though the image is at device resolution, core/internal/screenshot/screenshot.go:794
    Checked: the saved-region producers (selection, scroll, cross-output), its consumers (last-region capture, geometry, pre-selection), the screencopy wire coordinates per compositor, and result.Scale consumers. Model: claude-opus-5-5.

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found. Both earlier findings are fixed: pre-selection now reads the saved region as logical, and result.Scale reports the real output scale.
Checked: the saved-region producers (selection, scroll, cross-output, which is not saved), its consumers (last-region capture, geometry, pre-selection, CLI JSON), screencopy wire coordinates for protocol compositors vs Mango, the transformed-output path, and window capture through captureRegionOnOutput. Model: claude-opus-5-5.

@bbedward
bbedward merged commit 38f5f3b into duxlabs-dev:master Nov 2, 2026
4 checks passed
purian23 pushed a commit that referenced this pull request Nov 2, 2026
@hthienloc
hthienloc deleted the fix/screenshot-last-geometry branch November 15, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Go daemon and CLI under core/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants