-
Notifications
You must be signed in to change notification settings - Fork 16.5k
fix: broken transparent window styles on resizable change #48378
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: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zoy-l the failures are related, see e.g.:
not ok 401 BrowserWindow module window states resizable state does affect maximizability when disabled and enabled
I’ll fix it later. |
Hmm, this seems a bit off. I need to test it again.😅 |
The release notes are meant for app developers upgrading their Electron version. They should be relatively simple overall. Example: "Fixed issue where changing Could you update them, please? |
@nikwen 👌 |
Description of Change
Fix: #4835
Fix #48421
If resizable: false is set during titleBarOverlay initialization, the maximize button is still available.
Reason: When setting up a transparent window during initialization, calling SetCanResize(true) triggers OnSizeConstraintsChanged. The internal check finds CanResize is true, and since we removed the is_translucent_ check, this causes an unintended window-style flag to be set.
Change Description:
Override the internal
CanResize
function to prevent inconsistencies with Chromium’s internal state.SetResizable
no longer needs to repeatedly triggerOnSizeConstraintsChanged
and callSetMaximizable
.Background:
Previous Process
SetResizable(true)
first triggeredOnSizeConstraintsChanged
.can_resize
flag was stillfalse
.canMaximize
check (delegate->CanMaximize() && can_resize
) evaluated tofalse
, which applied a disabled style.SetMaximizable
was then called to restore the correct style.SetCanResize
updated Chromium’s internal state and triggeredOnSizeConstraintsChanged
again, correctly applying the style.To fix the background material, the !is_translucent_ check for can_resize was removed in HWNDMessageHandler::SizeConstraintsChanged, which exposed this issue. See fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch for reference.
This brings two changes that need to be confirmed.: one is that windows with thickFrame: false can no longer get the maximize button unless implemented manually. The other is that when thickFrame is false, isResizable is always false under normal circumstances.
Note: In previous versions, transparent windows did not support resizing by dragging the borders.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where changing the resizable property on a window would break the styles of a transparent window.