Repository navigation
feat(screenshot): snap to active popouts & modals in region mode - #3618
Merged
Merged
Conversation
Allow region screenshot selector to detect and snap to visible shell popouts and modals on hover and click or keyboard confirmation. - PopoutManager.qml: add getActiveSurfaces() collecting visible DankPopout and DankModal global bounding boxes - DMSShellIPC.qml: add screenshot.getSurfaces IPC endpoint - core: fetch snap targets from shell IPC during region screenshot init - selector: highlight snap targets on hover with surface name and dimensions - selector: click or Enter/Space on hovered target locks selection to surface bounds - selector: allow hover snap over pre-selection (SelectionState.fromPreSelect) - selector: reset selection on degenerate (1x1) click release for quick re-selection - unit tests for display name formatting, hover detection, and render bounds
Member
Author
|
/claude review |
Contributor
Claude reviewTwo bugs in the snap logic need fixing before merge.
|
- region_input: fix drag-away snap cancellation by setting hasSelection=true and clearing preSelect so freeform dragging renders and is not discarded - region_input: add snapToTarget helper subtracting 1 device pixel (devPxX/Y) from currentX/currentY to prevent inclusive coordinate off-by-one (420x580 -> 420x580) - region_render: compute hover bounds with w = round(width * scaleX) and x2 = x1 + w - 1 to eliminate +1 device pixel in render bounds - region_snap_test: assert exact 420x580 bounds for both hover and snapped states
Member
Author
|
/claude review |
Contributor
Claude reviewNo issues found. Both earlier findings are fixed: dragging away from a snap target now draws and keeps the selection, and the snapped capture subtracts one device pixel so it matches the target size. |
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.
What
Adds snap-to-surface behavior in region screenshot mode (
dms screenshot):screenshot.getSurfacesshell IPC endpoint querying visibleDankPopoutandDankModalbounding boxes.[<surface-name>] <W>x<H>.Return/Spacewhile hovering locks the selection to the surface bounds.~/.cache/dms/screenshot-state.json).Why
Capturing open shell popouts (Control Center, App Launcher, Clipboard, Wi-Fi password modal, etc.) required manual pixel-precise dragging. Snapping automatically aligns to the exact window bounding box.
recording_2026-09-29_13-19-29.mp4