Skip to content

Conversation

@leaanthony
Copy link
Member

@leaanthony leaanthony commented Dec 17, 2025

Summary

  • Fix fullscreen click-through on Windows when using Frameless: true with BackgroundTypeTransparent
  • Remove WS_EX_TRANSPARENT extended style flag when entering fullscreen to capture mouse events
  • Restore original style when exiting fullscreen

Fixes #4408

Root Cause

When a window is configured with Frameless: true and BackgroundType: BackgroundTypeTransparent, Wails sets WS_EX_TRANSPARENT | WS_EX_LAYERED on the window's extended style. The WS_EX_TRANSPARENT flag causes Windows to pass mouse events through the window.

The fullscreen() function preserved this flag when entering fullscreen mode - it only removed WS_EX_DLGMODALFRAME but kept WS_EX_TRANSPARENT, causing clicks to pass through to underlying windows/applications.

The Fix

Modified fullscreen() in webview_window_windows.go to also remove WS_EX_TRANSPARENT when entering fullscreen:

// Before:
w.previousWindowExStyle & ^uint32(w32.WS_EX_DLGMODALFRAME)

// After:
w.previousWindowExStyle & ^uint32(w32.WS_EX_DLGMODALFRAME|w32.WS_EX_TRANSPARENT)

The unfullscreen() function already correctly restores w.previousWindowExStyle, so the original click-through behavior is preserved when exiting fullscreen.

Test Plan

  • Create a Wails app with Frameless: true and BackgroundType: BackgroundTypeTransparent
  • Enter fullscreen mode using the HTML5 Fullscreen API
  • Verify mouse clicks are captured by the fullscreen element (not passed through)
  • Exit fullscreen mode
  • Verify click-through behavior is restored (if originally enabled)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue on Windows where mouse clicks could pass through frameless fullscreen windows with transparent backgrounds, restoring reliable user interaction with the app window.

✏️ Tip: You can customize this high-level summary in your review settings.

Fixed GitHub issue wailsapp#4408: **Fullscreen API click-through with certain window options**

### The Problem
When a Wails window is configured with both `Frameless: true` and `BackgroundType: BackgroundTypeTransparent`, mouse clicks pass through to underlying windows/applications when entering fullscreen mode via the HTML5 Fullscreen API.

### Root Cause
When these options are enabled, Wails sets `WS_EX_TRANSPARENT | WS_EX_LAYERED` on the window's extended style (line 319). The `WS_EX_TRANSPARENT` flag causes Windows to ignore mouse events for the window.

The `fullscreen()` function preserved this flag when entering fullscreen mode - it only removed `WS_EX_DLGMODALFRAME` but kept `WS_EX_TRANSPARENT`, causing the click-through behavior.

### The Fix
Modified `webview_window_windows.go:852` to also remove `WS_EX_TRANSPARENT` when entering fullscreen:

```go
// Before:
w.previousWindowExStyle & ^uint32(w32.WS_EX_DLGMODALFRAME)

// After:
w.previousWindowExStyle & ^uint32(w32.WS_EX_DLGMODALFRAME|w32.WS_EX_TRANSPARENT)
```

The `unfullscreen()` function already correctly restores `w.previousWindowExStyle`, so the original click-through behavior is preserved when exiting fullscreen.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

A Windows-specific fix: the fullscreen() path now clears additional extended window styles (WS_EX_TRANSPARENT and WS_EX_LAYERED alongside WS_EX_DLGMODALFRAME) to prevent mouse click-through when Frameless and BackgroundTypeTransparent are both used.

Changes

Cohort / File(s) Change Summary
Changelog
v3/UNRELEASED_CHANGELOG.md
Added a Fixed entry documenting the Windows fullscreen click-through fix for Frameless + BackgroundTypeTransparent.
Fullscreen implementation
v3/pkg/application/webview_window_windows.go
In fullscreen(), removed WS_EX_TRANSPARENT and WS_EX_LAYERED from the previous EXSTYLE mask (in addition to WS_EX_DLGMODALFRAME) so mouse events are captured in fullscreen; added explanatory comments referencing the click-through issue.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Bug, Windows, v3, v3-alpha, size:XS

Poem

🐰
Frameless and transparent met the night,
Clicks slipped past out of sight.
I nudged a flag, now events stay near —
Fullscreen holds the cursor dear. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main fix: addressing fullscreen click-through issues when Frameless and Transparent background are enabled on Windows.
Description check ✅ Passed The description covers the summary, root cause analysis, fix implementation, and test plan. While the description does not use the exact template structure, it provides all essential information needed to understand the PR.
Linked Issues check ✅ Passed The PR directly addresses issue #4408 by removing WS_EX_TRANSPARENT and WS_EX_LAYERED extended styles when entering fullscreen, ensuring mouse events are captured as required.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the fullscreen click-through issue: the changelog entry documents the fix, and the code modification addresses the exact problem described in issue #4408.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@sonarqubecloud
Copy link

@Untriel
Copy link

Untriel commented Dec 20, 2025

Just tested this on the latest alpha version. Removing w32.WS_EX_TRANSPARENT does not appear to be enough to fix the click-through behavior.

Additional testing: removing w32.WS_EX_LAYERED does allow the capture of clicks, but is not restored by unfullscreen().

leaanthony and others added 2 commits January 25, 2026 12:13
Testing revealed that removing WS_EX_TRANSPARENT alone is not sufficient
to fix click-through behavior. WS_EX_LAYERED must also be removed for
mouse events to be captured in fullscreen mode.

The unfullscreen() function already restores w.previousWindowExStyle,
so both flags will be properly restored when exiting fullscreen.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@leaanthony
Copy link
Member Author

Thanks for testing @Untriel! I've pushed a fix that also removes WS_EX_LAYERED in fullscreen mode. Could you test again with the latest commit?

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link

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.

2 participants