Skip to content

fix: preserve transparency across setResizable toggles on Windows - #51218

Merged
ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-preserve-transparency-across-setresizable-toggles-on-windows-1776792757917
Apr 21, 2026
Merged

ckerr merged 1 commit into
42-x-yfrom
trop/42-x-y-bp-fix-preserve-transparency-across-setresizable-toggles-on-windows-1776792757917

Conversation

@trop

@trop trop Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Backport of #51175

See that PR for details.

Notes: Fixed frameless transparent windows on Windows losing their transparency after setResizable(false) followed by setResizable(true).

After #49428 made `NativeWindowViews::CanResize()` return `resizable_`
for frameless windows (instead of `resizable_ && thick_frame_`),
`HWNDMessageHandler::SizeConstraintsChanged()` started adding
`WS_THICKFRAME` to the window style whenever `CanResize()` reported true.
`WS_THICKFRAME` is incompatible with layered (translucent) windows and
destroys their transparency.

`SetContentSizeConstraints` already guards against this by skipping
`OnSizeConstraintsChanged()` when `!thick_frame_`. `SetResizable` did
not, so toggling resizability on a transparent window (e.g.
`setResizable(false)` then `setResizable(true)`) caused the Chromium
path to add `WS_THICKFRAME` and strip transparency.

Apply the same guard in `SetResizable`. Min/max constraints are still
enforced — Chromium reads them from the widget delegate on every
`WM_GETMINMAXINFO`, independent of `SizeConstraintsChanged()`.

Co-authored-by: Shelley Vohr <[email protected]>
@trop
trop Bot requested review from a team and codebytere April 21, 2026 17:32
@trop trop Bot added 42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Apr 21, 2026
@ckerr
ckerr merged commit 2f3f637 into 42-x-y Apr 21, 2026
121 of 124 checks passed
@ckerr
ckerr deleted the trop/42-x-y-bp-fix-preserve-transparency-across-setresizable-toggles-on-windows-1776792757917 branch April 21, 2026 21:42
@release-clerk

release-clerk Bot commented Apr 21, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed frameless transparent windows on Windows losing their transparency after setResizable(false) followed by setResizable(true).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

42-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant