Repository navigation
Snap a bare capture click on any monitor, not only the focused one - #19030
omarchybot merged 1 commit into
Conversation
[Medium impact] The changes reach multi-monitor capture picking across shared screenshot and recording flows. The fix appears safe to merge, with a non-blocking test-isolation concern. Findings
SummaryExpands capture rectangles to every non-mirrored monitor and its active workspace.
Reviews (1) · Last reviewed commit: "Snap a bare capture click on any monitor..." · Reviewed by Greptile |
| printf '#!/bin/bash\n' >"$stub_bin/hyprpicker" | ||
| chmod +x "$stub_bin"/* | ||
|
|
||
| picked=$(SLURP_OUT="2200,300 1x1" SLURP_RECTS="$stub_bin/rects" PATH="$stub_bin:$PATH" "$ROOT/bin/omarchy-capture-region" smart --match-monitor) |
There was a problem hiding this comment.
Test clears live capture choices
The new test runs omarchy-capture-region with the session's real XDG_RUNTIME_DIR. If a real picker is open alongside the test, pick() can remove its marker files and discard the user's Return or Ctrl+Return selection. Set XDG_RUNTIME_DIR to the test's temporary directory for this call.
| picked=$(SLURP_OUT="2200,300 1x1" SLURP_RECTS="$stub_bin/rects" PATH="$stub_bin:$PATH" "$ROOT/bin/omarchy-capture-region" smart --match-monitor) | |
| picked=$(XDG_RUNTIME_DIR="$stub_bin" SLURP_OUT="2200,300 1x1" SLURP_RECTS="$stub_bin/rects" PATH="$stub_bin:$PATH" "$ROOT/bin/omarchy-capture-region" smart --match-monitor) |
|
Reviewed at 762bca7, and this looks ready for the maintainer: the cause in #18949 is right, the fix is the proportionate one, and nothing was found to change. Nothing was pushed to this branch. Reproduced and verified on a worker. On a stock Omarchy worker with a second output added through
What was only read, not run. I checked the jq membership test ( Second opinion. Codex (medium effort) and muse-wonder (via pi, thinking high) both reviewed the diff and found no defect. Their agreement with my reading is not guaranteed to be independent. Between them they added one point I had not reasoned about. This test's click at Related. #12512 rewrites the same Waiting on the maintainer. |
quattro's omacom#19030 already offers every laid-out monitor's active workspace and rectangle, so the conflict resolves to its visible_workspaces and mirror filter. What this branch adds on top is the monitor's open special workspace (scratchpad, Quake console), whose windows are otherwise never offered to the picker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With quattro's omacom#19030 testing every monitor's rectangles in capture-picker-binds-test.sh, the separate capture-multiple-displays-test.sh mostly repeated it. The one case it added, a window on an open special workspace, now sits in the existing fixture instead, as the testing guide asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omacom#19030 rewrote window_rects() to cover every laid-out monitor's active workspace. Combine its workspace predicate with this branch's .visible == true, and give its picker fixture clients the visible key Hyprland always reports, or the new filter drops them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changes
With more than one monitor, a bare click in the capture picker on a monitor other than the focused one did not snap to that monitor.
omarchy-capture-region smartreturned the rawX,Y 1x1click, so screen recording captured a 128x128 crop with gpu-screen-recorder, or nothing at all with the wf-recorder fallback.slurp draws on every output, but
omarchy-capture-regionbuilt its snap rectangles only for the focused monitor's active workspace. It now builds them for every monitor and for the windows on every monitor's visible workspace. A monitor that mirrors another is left out, since it has no place of its own in the layout.The picker's keyboard controls read the same rectangles, so they change too: Tab, Ctrl+Tab and the arrow keys now reach windows on the other monitors, and Return takes the window or monitor under the cursor on an unfocused monitor instead of falling back to the focused one. Ctrl+Return still takes the focused monitor. Dragging a region and single-monitor setups behave as before.
Verification
test/shell.d/capture-picker-binds-test.shthat runsomarchy-capture-region smart --match-monitorwith stubbedhyprctl,slurpandhyprpickeron a two-monitor layout, with a click on the unfocused monitor. It prints2200,300 1x1onquattroandmonitor:DP-1with this change. It also checks that slurp is given a window on the other monitor's visible workspace and not one on a workspace that isn't shown.bash test/shell.d/capture-picker-binds-test.sh: both cases pass.Screenshots
No screenshot: the change is in which region the picker returns for a click, and I had no multi-monitor session to record it in.
Fixes #18949