Repository navigation
feat(screenshot): add --geometry flag to selection coordinates - #3274
Conversation
- Add -g/--geometry persistent flag to print region geometry (X,Y WxH) to stdout. - Skip image buffer allocation, cropping, and file/clipboard/notification actions when in geometry mode. - Support standard Enter/Space confirmation or mouse release via --no-confirm. - Exit with code 1 when selection is cancelled, matching slurp behavior for script integrations. - Support printing geometry across last, window, output, full, and all modes. - Add unit tests in region_geometry_test.go.
…sult helpers - Add bounds() method on WaylandOutput to deduplicate Hyprland geometry lookup across output capture and search. - Add geometryResult() helper in screenshot package to eliminate redundant CaptureResult literals. - Add GeometryString() method on Region to unify geometry formatting. - Refactor selectedLogicalGeometry() to return Region directly. - Clean up flag validation in runScreenshot.
|
/claude review |
Claude reviewFeature works end to end, but the reported geometry does not match what DMS itself captures — three correctness issues, all in the new geometry paths.
Checked: flag wiring and mode/stdout guards, selection math against |
…utput - Derive selectedLogicalGeometry from selectionExtent and ext.logical to keep geometry in sync with inclusive selection bounds. - Use pointer int for X and Y in screenshotMetadata so (0,0) origins are preserved in JSON output. - Divide output dimensions by effectiveScale in bounds() for non-Hyprland compositors and handle transform rotation. - Convert stored device coordinates to logical units in captureLastRegion geometry mode. - Update and expand unit tests for inclusive bounds, preselection, and scaled outputs.
|
/claude review |
Claude reviewPrevious three findings are fixed; two new correctness issues remain in the geometry paths.
Checked: re-verified the three earlier findings (inclusive edges now match |
…nd handle niri window geometry - Guard SaveLastRegion in captureRegion with !s.config.Geometry to prevent overwriting saved region with logical coordinates. - Return explicit error when attempting window -g on niri instead of printing bogus 0,0 0x0 rect. - Populate Region dimensions in captureNiriWindow.
|
/claude review |
Claude reviewNo issues found. Both findings from the last round are fixed and I could not confirm anything new. Checked: |
Adds a
-g, --geometryflag todms screenshotto output selected geometry (X,Y WxH) directly tostdoutwithout capturing an image buffer, saving files, or copying to clipboard.I am planning to add screen recording to Quick Capture, but currently I have to use
slurpfor geometry capture. So this PR should help make DMS more self-contained. It would also be nice sincedms screenshothas better region selection than the alternatives.