Skip to content

fix(capture): select on any monitor - #167

Open
btsouth wants to merge 3 commits into
omacom:mainfrom
btsouth:fix/select-on-any-monitor
Open

btsouth wants to merge 3 commits into
omacom:mainfrom
btsouth:fix/select-on-any-monitor

Conversation

@btsouth

@btsouth btsouth commented Sep 24, 2026

Copy link
Copy Markdown

With more than one monitor, only the focused one can be selected. Hyprland keeps pointer focus on the overlay's exclusive-keyboard layer surface even when the cursor is on another output, so the overlay just gets motion past its own edge. That is also where the stray size badges in #166 come from.

After the overlay's first paint, a worker captures the other monitors and shows each one frozen and dimmed on its own layer surface. When the overlay sees motion past its edge, it moves to the monitor under the cursor and uses that monitor's frame and windows. Before it leaves a monitor, that monitor gets its own frozen layer first so the live desktop doesn't flash through. Clicks past the edge are ignored. The extra layers are removed when selection ends.

Fixes the selection part of #166. The editor placement from #164 is in #165.

Testing:

  • make check passes, with new tests for probing all monitors and for moving the overlay to another monitor.
  • Tested on Hyprland 0.56.2 with two monitors at 1.25x. Moved back and forth, dragged a region on the second monitor (saved PNG matched its pixels exactly), and Esc after moving clears both screens.

Going back to select from the editor stays on the current monitor, same as before.

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.

1 participant