Skip to content

Snap a bare capture click on any monitor, not only the focused one - #19030

Merged
omarchybot merged 1 commit into
omacom:quattrofrom
falkoro:fix/omarchy-capture-other-monitor-click-fix
Nov 16, 2026
Merged

omarchybot merged 1 commit into
omacom:quattrofrom
falkoro:fix/omarchy-capture-other-monitor-click-fix

Conversation

@falkoro

@falkoro falkoro commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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 smart returned the raw X,Y 1x1 click, 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-region built 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

  • Added a case to test/shell.d/capture-picker-binds-test.sh that runs omarchy-capture-region smart --match-monitor with stubbed hyprctl, slurp and hyprpicker on a two-monitor layout, with a click on the unfocused monitor. It prints 2200,300 1x1 on quattro and monitor:DP-1 with 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.
  • Ran bash test/shell.d/capture-picker-binds-test.sh: both cases pass.
  • Not checked on real hardware: I had no multi-monitor session to click in, so the picker itself was not opened.

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

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Test clears live capture choices ▶

Summary

Expands capture rectangles to every non-mirrored monitor and its active workspace.

  • Bare clicks now snap to any laid-out monitor.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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)

@falkoro falkoro changed the title fix: snap a bare capture click on any monitor, not only the focused one Snap a bare capture click on any monitor, not only the focused one Nov 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

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 hyprctl output create headless (Virtual-1 focused at 0,0, HEADLESS-1 unfocused at 1280,0), real slurp was opened through omarchy-capture-region smart --match-monitor, the way screen recording opens it, and clicked with ydotool:

  • On quattro, a click with a pixel of jitter on the unfocused HEADLESS-1 returned 1760,270 2x1, the tiny region the issue describes. A perfectly still click there did not end the picker at all.
  • With this branch, both kinds of click returned monitor:HEADLESS-1.
  • A click on the focused monitor returned monitor:Virtual-1 both before and after.
  • With the tree linked as the session's $OMARCHY_PATH, Return on HEADLESS-1 (the picker's --take-window bind) gave monitor:HEADLESS-1 on both quattro and this branch. Moving the cursor there already focuses that monitor before Return reads the rectangles, so in practice the keyboard path changes less than the description suggests. It is not wrong.
  • The new case in test/shell.d/capture-picker-binds-test.sh passes on this head and fails on quattro with got: 2200,300 1x1, which is the right failure. Both tests in the file pass on the worker.

What was only read, not run. I checked the jq membership test (index($id) != null correctly accepts index 0, and a null workspace id matches nothing), the mirrorOf exclusion (it is the same idiom as omarchy-hyprland-monitor-layout), and every consumer of the rectangles. Ctrl+Return still takes the focused monitor. Tab and the arrow keys now reach windows on the other monitors, which is the consistent result of a picker that spans every output. The only caller, omarchy-capture-screenrecording, takes the monitor:NAME it now gets. The new trap replaces no earlier trap in that file. Special workspaces are still not hinted, on any monitor, but that was true on the focused monitor before and is outside #18949.

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 2200,300 falls inside the stub window 2000,100 800x600, and it expects monitor:DP-1 only because the bare-click loop takes the first rectangle, which is a monitor. #14665 changes that loop to take the smallest rectangle, so whichever of the two lands second needs this click moved to empty space on DP-1.

Related. #12512 rewrites the same window_rects jq line, so it will conflict textually, and its .visible predicate has to be kept alongside this one. #6122 attempted this fix in the scripts that existed before omarchy-capture-region, and this change replaces it. The branch merges cleanly with quattro as it stands.

Waiting on the maintainer.

@omarchybot
omarchybot merged commit 1b38e58 into omacom:quattro Nov 16, 2026
3 checks passed
omarchybot added a commit to Tunahanyrd/omarchy that referenced this pull request Nov 16, 2026
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>
omarchybot added a commit to Tunahanyrd/omarchy that referenced this pull request Nov 16, 2026
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>
omarchybot added a commit to sanjyay/omarchy that referenced this pull request Nov 17, 2026
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>
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.

Capture picker: a click on a non-focused monitor doesn't snap, so screen recording captures a 1x1 region (128x128 crop or nothing)

2 participants