Skip to content

Add WindowOptions::clickThrough, so a window passes mouse clicks through - #13

Merged
3vcloud merged 1 commit into
mainfrom
click-through
Nov 13, 2026
Merged

3vcloud merged 1 commit into
mainfrom
click-through

Conversation

@3vcloud

@3vcloud 3vcloud commented Nov 13, 2026

Copy link
Copy Markdown
Member

Summary

  • `WindowOptions::clickThrough` makes a window pass mouse clicks through to whatever is beneath it. The page gets no pointer input. It's fixed when the window opens.
  • Windows: adds `WS_EX_TRANSPARENT` to the extended style.
  • Linux: sets an empty input shape on the GTK window. The cairo region is loaded at runtime, like the rest of GTK. `gdk_window_set_pass_through` was tried first and didn't stop X from reporting the window under the pointer.
  • The example takes `--click-through`.

Tests

  • `tests/linux_click_through_test.sh`: moves the pointer over the example window and checks the window X reports under it. With the flag it must be another window; without it, the example's own window. Passes on X11 (run against the merged tree).
  • `tests/windows_click_through_test.ps1`: the same checks with `WindowFromPoint`. Added to `.github/workflows/windows-permissions.yml`. Not run yet. It needs the Windows runner to confirm that `WindowFromPoint` skips `WS_EX_TRANSPARENT` windows and that the flag works with WebView2's composition.
  • `tests/linux_example_test.sh` still passes on the merged tree.

Based on `main`. It's a single commit, cherry-picked from `notifications` so the notification test commit isn't included.

🤖 Generated with Claude Code

A window opened with clickThrough never takes pointer input: clicks reach whatever is beneath it. It's set when the window
opens. On Windows it adds WS_EX_TRANSPARENT to the extended style. On Linux it sets an empty input shape on the GTK window,
with the cairo region loaded at runtime like the rest of GTK.

The example takes --click-through. The new tests check that the window under the pointer is the window beneath the example
when it's set, and the example's own window when it isn't: tests/linux_click_through_test.sh on X11, and
tests/windows_click_through_test.ps1, which the Windows CI workflow runs.
@3vcloud
3vcloud merged commit e433a85 into main Nov 13, 2026
2 checks passed
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