Skip to content

Per-pixel surround click-through mask (#131)#136

Merged
dfattal merged 1 commit into
mainfrom
feat/surround-mask-clickthrough
May 31, 2026
Merged

Per-pixel surround click-through mask (#131)#136
dfattal merged 1 commit into
mainfrom
feat/surround-mask-clickthrough

Conversation

@dfattal
Copy link
Copy Markdown
Collaborator

@dfattal dfattal commented May 31, 2026

A 2D surround element with a non-rectangular shape (a comic bubble with a
triangular tail) could only register a single bounding RECT for click-through
(displayxr_set_overlay_surround_rect), so the transparent corners beside the
tail caught clicks instead of routing to the desktop.

Add displayxr_set_overlay_surround_mask(mask, mask_w, mask_h, dst_x,y,w,h): an
owned per-pixel alpha mask of the element's exact shape, RLE-unioned into the
SetWindowRgn region by displayxr_set_overlay_hit_mask using the same encoder as
the tiger silhouette, mapped over its own dst rect. The empty area beside the
shape stays click-through. The surround is flat post-weave 2D (no disparity /
per-view union), so callers rasterize the mask directly on the CPU — no GPU
silhouette pass. The single-rect API stays for compat; both are unioned in.

Windows-only (displayxr_win32.c); macOS resolves via the C# EntryPointNotFound
fallback like the existing surround-rect entry point.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

A 2D surround element with a non-rectangular shape (a comic bubble with a
triangular tail) could only register a single bounding RECT for click-through
(displayxr_set_overlay_surround_rect), so the transparent corners beside the
tail caught clicks instead of routing to the desktop.

Add displayxr_set_overlay_surround_mask(mask, mask_w, mask_h, dst_x,y,w,h): an
owned per-pixel alpha mask of the element's exact shape, RLE-unioned into the
SetWindowRgn region by displayxr_set_overlay_hit_mask using the same encoder as
the tiger silhouette, mapped over its own dst rect. The empty area beside the
shape stays click-through. The surround is flat post-weave 2D (no disparity /
per-view union), so callers rasterize the mask directly on the CPU — no GPU
silhouette pass. The single-rect API stays for compat; both are unioned in.

Windows-only (displayxr_win32.c); macOS resolves via the C# EntryPointNotFound
fallback like the existing surround-rect entry point.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dfattal dfattal merged commit 07a984e into main May 31, 2026
4 checks passed
@dfattal dfattal deleted the feat/surround-mask-clickthrough branch May 31, 2026 19:26
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