-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(windows): Fullscreen click-through with Frameless + Transparent background #4814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3-alpha
Are you sure you want to change the base?
Conversation
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.
WalkthroughA 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
|
|
Just tested this on the latest alpha version. Removing Additional testing: removing |
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>
|
Thanks for testing @Untriel! I've pushed a fix that also removes |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|



Summary
Frameless: truewithBackgroundTypeTransparentWS_EX_TRANSPARENTextended style flag when entering fullscreen to capture mouse eventsFixes #4408
Root Cause
When a window is configured with
Frameless: trueandBackgroundType: BackgroundTypeTransparent, Wails setsWS_EX_TRANSPARENT | WS_EX_LAYEREDon the window's extended style. TheWS_EX_TRANSPARENTflag causes Windows to pass mouse events through the window.The
fullscreen()function preserved this flag when entering fullscreen mode - it only removedWS_EX_DLGMODALFRAMEbut keptWS_EX_TRANSPARENT, causing clicks to pass through to underlying windows/applications.The Fix
Modified
fullscreen()inwebview_window_windows.goto also removeWS_EX_TRANSPARENTwhen entering fullscreen:The
unfullscreen()function already correctly restoresw.previousWindowExStyle, so the original click-through behavior is preserved when exiting fullscreen.Test Plan
Frameless: trueandBackgroundType: BackgroundTypeTransparent🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.