ada53b090e
Anchor the webcam overlay to the recorded region, not the monitor ( #6384 )
...
* Anchor the webcam overlay to the recorded region, not the monitor
Recording a single window on an ultrawide put the camera outside the frame.
The overlay is placed twice, and neither placement knows what is being
captured: the window rules in default/hypr/apps/webcam-overlay.lua position it
from monitor_w/monitor_h, and omarchy-capture-webcam-resize recomputes the same
corner from hyprctl monitors. Both resolve to the monitor's bottom-right, so a
window anywhere but the far right of the display records without the camera in
it, and dragging it into frame by hand is undone by the next resize.
The geometry is already known. select_capture_target resolves the picked window
to a region rectangle before start_webcam_overlay runs, and a bare click in
smart mode snaps that rectangle to the window's own bounds. gpu-screen-recorder
takes the region in the compositor's logical coordinate space, which is the
same space window moves take, so the value needs no conversion to be reused as
an anchor.
Publish it for the resize helper, which becomes the single place that positions
the overlay. It anchors to the region when one is recorded and falls back to
the monitor otherwise, so full-monitor captures, the portal backend, and manual
resizes outside a recording all keep their current behaviour. A malformed or
empty file falls back the same way.
Presets scale from the anchor's height rather than the monitor's, so the camera
keeps its proportion of the frame instead of covering a small capture outright.
A tall, narrow region cannot fit a preset derived from its height, so widths are
capped to the space available and heights follow at the same 8:9 aspect.
Placement happens inside start_webcam_overlay rather than after it returns.
Correcting the position once that function had returned left the move adjacent
to gpu-screen-recorder starting, and the camera was recorded sliding the last
stretch into its corner over the opening frames. The overlay is waited for
explicitly instead, positioned, and only then does capture start.
Waiting for the map is what the blind second was partly guessing at, so the
remainder is trimmed to hold the delay before capture where it was. Starting
later is not free: it eats the opening words of whatever is being narrated.
* Keep the webcam size ladder usable in a narrow region
Capping each preset's width to the region separately collapsed small,
medium and large onto the same width, so Super + Alt + [ and ] had
nothing to step between, and integer division left small taller than
medium. Cap the height the presets scale from instead, which shrinks
the ladder as a whole and keeps the three sizes ordered and distinct.
Cover the anchoring in the test suite: a region the camera follows, the
fallback for an unreadable one, and the narrow-region ladder. Point
XDG_RUNTIME_DIR at the test's own directory while doing so — the resize
helper now reads a region file from there, and the existing geometry
assertions would pick up a real one from a live recording.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
---------
Co-authored-by: David Heinemeier Hansson <david@hey.com >
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-07-26 15:27:06 -07:00
..
2026-07-24 12:15:02 -07:00
2026-05-16 20:34:09 +02:00
2026-05-21 11:53:48 +02:00
2026-07-24 18:25:02 -07:00
2026-07-24 18:25:02 -07:00
2026-07-24 18:25:02 -07:00
2026-07-24 18:25:02 -07:00
2026-07-24 18:25:02 -07:00
2026-05-22 13:26:26 +02:00
2026-07-24 18:32:31 -07:00
2026-07-24 12:25:20 -07:00
2026-07-25 11:14:04 -07:00
2026-07-08 11:49:56 -07:00
2026-05-21 15:45:36 +02:00
2026-05-01 17:40:22 +02:00
2026-07-20 16:37:33 -07:00
2026-05-21 11:29:55 +02:00
2026-05-11 09:53:07 +02:00
2026-05-11 09:53:07 +02:00
2026-07-19 19:42:18 -07:00
2026-06-24 13:52:37 +02:00
2026-06-24 13:52:37 +02:00
2026-05-02 10:24:31 +02:00
2026-07-03 10:13:19 -07:00
2026-07-26 15:27:06 -07:00
2026-05-25 20:28:22 +02:00
2026-07-18 15:42:01 -07:00
2026-07-15 18:23:40 -07:00
2026-07-26 15:27:06 -07:00
2026-06-29 11:28:32 -05:00
2026-07-23 17:05:29 -07:00
2026-07-22 17:25:28 -07:00
2026-06-04 11:15:28 +02:00
2026-07-24 12:25:20 -07:00
2026-06-29 13:45:11 -05:00
2026-07-24 12:25:20 -07:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-19 09:59:13 -07:00
2026-06-06 13:28:47 -04:00
2026-05-21 07:57:08 +02:00
2026-07-24 09:01:17 -07:00
2026-05-19 21:42:02 +02:00
2026-06-04 18:38:25 -04:00
2026-06-12 13:49:46 -04:00
2026-07-22 17:32:01 -07:00
2026-05-17 21:55:53 +02:00
2026-05-27 12:36:47 +02:00
2026-07-23 17:05:29 -07:00
2026-06-06 20:36:21 -04:00
2026-06-08 12:03:40 -04:00
2026-07-18 16:24:51 -07:00
2026-05-21 19:30:30 +02:00
2026-07-23 14:19:24 -07:00
2026-07-22 17:31:14 -07:00
2026-07-22 16:45:17 -07:00
2026-07-16 21:53:15 -07:00
2026-05-01 17:40:22 +02:00
2026-07-18 18:21:39 -07:00
2026-05-06 12:58:55 +02:00
2026-07-24 03:26:49 +09:00
2026-07-26 14:53:29 -07:00
2026-05-14 16:34:21 -04:00
2026-05-01 17:40:22 +02:00
2026-07-25 08:46:39 -07:00
2026-05-11 13:01:45 +02:00
2026-06-04 18:37:32 -04:00
2026-05-01 17:40:22 +02:00
2026-05-15 11:03:21 +02:00
2026-07-18 10:08:43 -07:00
2026-05-07 10:33:12 +02:00
2026-05-07 10:34:28 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-07 12:10:45 +02:00
2026-07-23 13:51:07 -07:00
2026-05-08 21:07:51 +02:00
2026-05-01 17:40:22 +02:00
2026-05-17 17:29:52 +02:00
2026-05-21 19:30:30 +02:00
2026-07-25 13:37:17 -07:00
2026-05-01 17:40:22 +02:00
2026-07-18 10:08:43 -07:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-18 12:31:25 -07:00
2026-07-20 08:09:07 -07:00
2026-07-23 13:51:07 -07:00
2026-05-01 17:40:22 +02:00
2026-05-25 20:28:39 +02:00
2026-05-03 15:58:32 +02:00
2026-05-03 15:58:32 +02:00
2026-05-11 10:40:26 -04:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-23 16:33:12 -07:00
2026-07-17 10:20:08 -07:00
2026-07-24 12:28:55 -07:00
2026-07-02 22:14:33 -07:00
2026-05-01 17:40:22 +02:00
2026-05-05 21:18:09 +02:00
2026-07-24 12:28:55 -07:00
2026-07-24 12:28:55 -07:00
2026-07-24 12:28:55 -07:00
2026-07-23 20:37:25 -07:00
2026-07-20 08:15:09 -07:00
2026-06-09 15:13:23 -04:00
2026-05-17 19:51:29 +02:00
2026-05-11 10:40:26 -04:00
2026-05-11 10:40:26 -04:00
2026-07-16 21:19:28 -07:00
2026-05-01 17:40:22 +02:00
2026-05-11 10:40:26 -04:00
2026-05-10 11:26:59 +02:00
2026-05-29 15:59:13 +02:00
2026-05-11 10:40:26 -04:00
2026-05-23 13:37:57 +02:00
2026-07-23 21:03:43 -07:00
2026-05-17 21:30:58 +02:00
2026-05-14 17:43:12 -04:00
2026-07-22 17:25:28 -07:00
2026-07-22 17:25:28 -07:00
2026-05-04 13:23:27 +02:00
2026-06-04 11:15:28 +02:00
2026-05-01 17:40:22 +02:00
2026-05-04 13:23:27 +02:00
2026-07-23 00:03:40 -04:00
2026-06-09 19:48:37 -04:00
2026-05-27 10:53:30 +02:00
2026-05-27 10:53:30 +02:00
2026-05-14 17:43:12 -04:00
2026-06-24 13:31:17 +02:00
2026-05-27 11:15:21 +02:00
2026-05-27 11:15:21 +02:00
2026-05-04 13:23:27 +02:00
2026-05-04 13:23:27 +02:00
2026-07-18 12:30:54 -07:00
2026-05-04 13:23:27 +02:00
2026-05-27 11:15:21 +02:00
2026-05-27 11:15:21 +02:00
2026-05-25 17:29:02 +02:00
2026-07-17 16:28:17 -07:00
2026-05-27 10:53:30 +02:00
2026-05-27 10:53:30 +02:00
2026-05-25 18:19:06 +02:00
2026-05-25 18:12:40 +02:00
2026-06-04 18:37:32 -04:00
2026-07-17 16:28:17 -07:00
2026-05-15 17:44:09 +02:00
2026-06-23 16:22:27 +02:00
2026-06-23 16:22:27 +02:00
2026-07-22 16:10:45 -07:00
2026-05-01 17:40:22 +02:00
2026-05-21 19:30:30 +02:00
2026-07-24 09:01:17 -07:00
2026-05-19 17:08:14 +02:00
2026-05-22 14:24:04 +02:00
2026-07-20 09:44:48 -07:00
2026-05-14 13:15:03 +02:00
2026-05-14 11:12:25 +02:00
2026-05-11 10:40:26 -04:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-24 09:31:55 -07:00
2026-05-25 18:19:06 +02:00
2026-05-25 18:12:40 +02:00
2026-05-14 10:56:10 +02:00
2026-05-14 10:57:44 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-23 04:32:20 -04:00
2026-05-20 14:09:09 +02:00
2026-05-20 14:12:06 +02:00
2026-05-29 15:25:21 +02:00
2026-05-19 20:54:20 +02:00
2026-06-24 13:49:22 +02:00
2026-05-19 20:54:20 +02:00
2026-07-25 13:39:42 -07:00
2026-05-19 20:54:20 +02:00
2026-07-02 22:14:33 -07:00
2026-06-29 08:51:15 -05:00
2026-07-19 10:00:46 -07:00
2026-07-26 14:53:29 -07:00
2026-07-26 14:53:29 -07:00
2026-07-23 11:26:32 +03:00
2026-07-23 16:48:29 -07:00
2026-07-22 15:52:58 -07:00
2026-06-28 20:11:21 -04:00
2026-05-14 12:02:53 +02:00
2026-05-20 14:24:19 +02:00
2026-05-25 23:51:48 +02:00
2026-05-14 12:02:53 +02:00
2026-07-26 14:53:29 -07:00
2026-07-07 09:18:03 -07:00
2026-07-24 16:48:14 -07:00
2026-06-04 18:35:01 -04:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-18 12:31:03 -07:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-24 12:25:20 -07:00
2026-07-18 10:08:43 -07:00
2026-07-18 10:08:43 -07:00
2026-07-18 10:08:43 -07:00
2026-07-24 12:19:39 -07:00
2026-07-24 12:19:39 -07:00
2026-07-18 10:08:43 -07:00
2026-07-24 12:20:04 -07:00
2026-07-18 10:08:43 -07:00
2026-07-24 12:19:39 -07:00
2026-07-24 12:19:39 -07:00
2026-06-29 10:49:43 -05:00
2026-07-19 09:33:23 -07:00
2026-07-19 21:29:15 -07:00
2026-07-19 21:29:15 -07:00
2026-06-04 18:37:32 -04:00
2026-07-22 17:25:28 -07:00
2026-06-22 18:30:16 +02:00
2026-06-16 01:25:04 -04:00
2026-05-01 17:40:22 +02:00
2026-07-18 10:08:43 -07:00
2026-06-04 18:38:25 -04:00
2026-07-18 10:08:43 -07:00
2026-07-18 10:08:43 -07:00
2026-07-16 21:15:00 -07:00
2026-05-01 17:40:22 +02:00
2026-06-04 18:37:32 -04:00
2026-06-04 18:38:25 -04:00
2026-06-04 18:38:25 -04:00
2026-05-23 18:04:21 +02:00
2026-07-24 09:01:17 -07:00
2026-05-01 17:40:22 +02:00
2026-06-29 14:49:39 -05:00
2026-07-18 10:08:43 -07:00
2026-05-04 11:18:25 +02:00
2026-05-04 10:31:06 +02:00
2026-05-04 08:57:19 +02:00
2026-07-18 12:30:54 -07:00
2026-05-04 08:57:19 +02:00
2026-05-04 09:57:13 +02:00
2026-05-27 11:15:21 +02:00
2026-07-18 10:08:43 -07:00
2026-06-16 01:25:04 -04:00
2026-05-08 20:52:29 +02:00
2026-07-26 12:31:04 -07:00
2026-07-18 16:09:03 -07:00
2026-05-25 17:29:02 +02:00
2026-07-17 16:28:17 -07:00
2026-05-16 13:00:30 +02:00
2026-07-17 16:28:17 -07:00
2026-05-01 17:40:22 +02:00
2026-05-22 13:26:46 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-20 09:44:48 -07:00
2026-05-05 12:53:51 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-24 09:31:09 -07:00
2026-05-01 17:40:22 +02:00
2026-07-23 17:40:47 -07:00
2026-05-05 14:22:03 +02:00
2026-05-21 10:19:36 +02:00
2026-05-01 17:40:22 +02:00
2026-05-19 21:01:15 -04:00
2026-07-24 12:24:30 -07:00
2026-06-04 18:38:25 -04:00
2026-07-24 12:22:36 -07:00
2026-05-08 20:52:29 +02:00
2026-07-26 12:31:04 -07:00
2026-07-24 12:25:20 -07:00
2026-07-24 12:27:01 -07:00
2026-07-25 07:03:58 -07:00
2026-07-24 12:16:51 -07:00
2026-05-01 17:40:22 +02:00
2026-06-04 18:34:04 -04:00
2026-07-18 10:08:43 -07:00
2026-05-06 13:20:34 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-25 12:35:17 -07:00
2026-07-18 10:08:43 -07:00
2026-07-24 16:48:14 -07:00
2026-07-24 16:48:14 -07:00
2026-07-24 16:48:14 -07:00
2026-07-25 12:35:17 -07:00
2026-07-18 10:08:43 -07:00
2026-05-21 11:58:43 +02:00
2026-06-22 21:48:35 +02:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-07-24 12:25:20 -07:00
2026-07-18 16:24:51 -07:00
2026-07-24 12:24:09 -07:00
2026-07-24 12:19:39 -07:00
2026-05-03 19:36:50 +02:00
2026-07-24 12:24:09 -07:00
2026-07-03 09:06:31 -07:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-07-19 19:05:42 -07:00
2026-06-09 19:48:37 -04:00
2026-07-03 09:06:31 -07:00
2026-05-06 13:20:34 +02:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-07-03 09:06:31 -07:00
2026-07-15 18:13:39 -07:00
2026-06-09 19:48:37 -04:00
2026-06-09 19:48:37 -04:00
2026-05-01 17:40:22 +02:00
2026-07-25 07:19:02 -07:00
2026-06-04 11:14:04 +02:00
2026-06-04 11:14:04 +02:00
2026-05-01 17:40:22 +02:00
2026-07-18 10:08:43 -07:00
2026-07-21 15:25:49 -07:00
2026-07-24 12:18:25 -07:00
2026-07-21 16:01:49 -07:00
2026-07-19 22:46:27 -07:00
2026-07-24 12:17:16 -07:00
2026-07-24 12:17:16 -07:00
2026-07-24 12:18:25 -07:00
2026-07-24 12:18:25 -07:00
2026-07-22 16:39:00 -07:00
2026-07-02 22:09:14 -07:00
2026-06-04 18:37:32 -04:00
2026-06-28 20:46:23 -04:00
2026-07-18 10:08:43 -07:00
2026-07-23 18:58:55 -07:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-23 15:28:32 -07:00
2026-06-04 19:23:54 -04:00
2026-07-23 15:28:32 -07:00
2026-05-01 17:40:22 +02:00
2026-05-08 20:48:36 +02:00
2026-05-25 16:49:18 +02:00
2026-06-04 18:38:25 -04:00
2026-06-04 18:38:25 -04:00
2026-06-04 18:38:25 -04:00
2026-05-15 15:21:03 +02:00
2026-07-25 14:01:38 -07:00
2026-05-01 17:40:22 +02:00
2026-06-04 18:38:25 -04:00
2026-07-25 14:01:38 -07:00
2026-07-18 10:08:43 -07:00
2026-06-04 18:38:25 -04:00
2026-06-04 18:38:25 -04:00
2026-06-29 11:28:32 -05:00
2026-05-01 17:40:22 +02:00
2026-05-29 14:36:26 -04:00
2026-07-22 21:39:15 -07:00
2026-05-14 16:33:51 -04:00
2026-07-22 21:39:15 -07:00
2026-05-16 21:01:09 +02:00
2026-07-16 14:46:56 -07:00
2026-07-16 14:46:56 -07:00
2026-07-16 14:46:56 -07:00
2026-05-01 17:40:22 +02:00
2026-05-01 17:40:22 +02:00
2026-07-22 17:02:52 -07:00
2026-06-28 20:46:23 -04:00
2026-07-18 10:08:43 -07:00
2026-07-18 10:08:43 -07:00