SIGN IN SIGN UP
wailsapp / wails UNCLAIMED

Create beautiful applications using Go

0 0 1 Go

fix(windows): use WM_NCHITTEST instead of removing WS_EX_LAYERED in fullscreen

Removing WS_EX_LAYERED dynamically breaks the layered window rendering
because unfullscreen() cannot properly re-initialize the compositing
pipeline when re-adding the flag via SetWindowLong (the window was
originally created with WS_EX_LAYERED via CreateWindowEx which auto-
initializes, but dynamically adding it requires explicit calls to
SetLayeredWindowAttributes or UpdateLayeredWindow).

Instead, keep WS_EX_LAYERED set and handle the alpha-based hit-testing
issue in WndProc: return HTCLIENT for WM_NCHITTEST when fullscreen is
active, forcing all mouse events to be captured regardless of pixel
alpha values. WS_EX_TRANSPARENT is still removed in fullscreen() to
prevent explicit click-through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
L
Lea Anthony committed
2a9cdc0e736111d27510b8d5b8c26c2ca9b8e727
Parent: 8a658a8