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
fix: max window size defaults to 0 #33025
Conversation
patches/chromium/fix_don_t_restore_maximized_windows_when_calling_showinactive.patch
Outdated
Show resolved
Hide resolved
e67200b
to
b38d835
Compare
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.
Instead of setting maximum size to (INT_MAX, INT_MAX)
, the code should only call size_constraints.set_maximum_size
when there is a maximum size set.
By default the window has a default maximum size that prevents it from being resized larger than screen, assigning a maximum size would override this behavior, see also:
electron/shell/browser/native_window_views.cc
Lines 211 to 217 in bcf060f
if (enable_larger_than_screen()) | |
// We need to set a default maximum window size here otherwise Windows | |
// will not allow us to resize the window larger than scree. | |
// Setting directly to INT_MAX somehow doesn't work, so we just divide | |
// by 10, which should still be large enough. | |
SetContentSizeConstraints(extensions::SizeConstraints( | |
gfx::Size(), gfx::Size(INT_MAX / 10, INT_MAX / 10))); |
a0dd22e
to
30d5e96
Compare
94de305
to
99bc58b
Compare
Failure not relevant - merging. |
Release Notes Persisted
|
I have automatically backported this PR to "17-x-y", please check out #33118 |
I have automatically backported this PR to "18-x-y", please check out #33119 |
Description of Change
Closes #32995.
Fixes an issue where setting window
maxHeight
ormaxWidth
made it so the width and height could no longer be resized.#32628 fixed an issue with
maxWidth
not being respected at all, but also changed defaults such thatmax_width
andmax_height
conformed tosize_constraints.GetMaximumSize()
. By default,size_constraints.GetMaximumSize()
returns(0, 0)
unless it's been previously set, so this accidentally made it such that themaxHeight
couldn't be changed if themaxWidth
was set, and vice versa. This fixes that issue.Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where setting window
maxHeight
ormaxWidth
made it so the width and height could no longer be resized.