Skip to content

fix(windows): prevent mouse click-through in fullscreen for transparent windows#5195

Merged
leaanthony merged 2 commits into
masterfrom
fix/4408-fullscreen-clickthrough
May 31, 2026
Merged

fix(windows): prevent mouse click-through in fullscreen for transparent windows#5195
leaanthony merged 2 commits into
masterfrom
fix/4408-fullscreen-clickthrough

Conversation

@leaanthony

@leaanthony leaanthony commented Apr 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove WS_EX_TRANSPARENT alongside WS_EX_DLGMODALFRAME when entering fullscreen mode to prevent layered window pass-through
  • Return HTCLIENT from WM_NCHITTEST while in fullscreen mode to force mouse event capture regardless of alpha-based hit-testing
  • Add test verifying the fullscreen hit-test logic

The root cause: When Frameless and BackgroundType: Transparent are both set, the window has WS_EX_LAYERED which uses alpha-based hit-testing. In fullscreen, transparent pixels (alpha=0) pass mouse events through to underlying windows. By removing WS_EX_TRANSPARENT and overriding WM_NCHITTEST to return HTCLIENT, all mouse events are captured.

Fixes #4408

Test plan

  • TestFullscreenNCHitTestReturnsHTClient — verifies hit-test returns HTCLIENT in fullscreen, doesn't in normal mode
  • GOOS=windows go build ./pkg/application/ — compiles cleanly
  • Manual testing: Create window with Frameless: true and BackgroundType: application.BackgroundTypeTransparent, enter fullscreen, verify clicks are captured

Summary by CodeRabbit

  • Bug Fixes

    • Fixed mouse click-through issue in fullscreen mode when using Frameless + Transparent window options on Windows.
  • Tests

    • Added test coverage for fullscreen click-through behavior.

…nt windows

When a window with both Frameless and BackgroundType (transparent)
options enters fullscreen, mouse clicks pass through to underlying
windows because WS_EX_LAYERED uses alpha-based hit-testing where
transparent pixels don't capture events.

Fix by:
1. Removing WS_EX_TRANSPARENT alongside WS_EX_DLGMODALFRAME when
   entering fullscreen
2. Returning HTCLIENT from WM_NCHITTEST while in fullscreen mode to
   force all mouse events to be captured by the window

Fixes #4408
@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7cec364-94e2-45c6-bab2-a54f7b6f20ec

📥 Commits

Reviewing files that changed from the base of the PR and between dcfce51 and 57f790b.

📒 Files selected for processing (3)
  • v3/UNRELEASED_CHANGELOG.md
  • v3/pkg/application/fullscreen_clickthrough_test.go
  • v3/pkg/application/webview_window_windows.go

Walkthrough

This PR preserves the transparent extended window style during fullscreen and short-circuits WM_NCHITTEST to HTCLIENT while fullscreen; adds a unit test for the hit-test decision and a changelog entry noting the Frameless+Transparent fullscreen click-through fix.

Changes

Fullscreen Click-Through Fix

Layer / File(s) Summary
Hit test capture validation
v3/pkg/application/fullscreen_clickthrough_test.go
New parameterized test validates shouldCaptureHitTest helper function returns the expected boolean for fullscreen and non-fullscreen cases.
Fullscreen extended style and hit test message handling
v3/pkg/application/webview_window_windows.go
Extended style preservation during fullscreen now includes WS_EX_TRANSPARENT; WndProc intercepts WM_NCHITTEST when fullscreen and returns HTCLIENT to capture client-area mouse events.
Changelog entry
v3/UNRELEASED_CHANGELOG.md
Documents the fix for mouse click-through behavior in fullscreen mode with Frameless + Transparent window options (refs #4408).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

Bug, go, Windows, v3, size:M

Poem

🐰 A rabbit hops through code at night,

preserving panes that hid the light,
hit-tests halted, clicks held fast,
Frameless transparent woes are past,
fullscreen now keeps users tight.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/4408-fullscreen-clickthrough

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@leaanthony leaanthony changed the base branch from v3-alpha to master April 29, 2026 13:07
@leaanthony leaanthony added this to the v3.0.0-beta.1 milestone May 20, 2026
@leaanthony leaanthony marked this pull request as ready for review May 31, 2026 07:13
Copilot AI review requested due to automatic review settings May 31, 2026 07:13
@leaanthony leaanthony merged commit ae5abd9 into master May 31, 2026
13 of 17 checks passed
@leaanthony leaanthony deleted the fix/4408-fullscreen-clickthrough branch May 31, 2026 07:13

Copilot AI left a comment

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Fullscreen API click through with certain window options

2 participants