DescriptionMac/Linux: Ensure window size constraints propagate to the window server during Init
Currently fixed-size views dialogs on Mac don't initialize properly.
(And, e.g., WebDialogBrowserTest.SizeWindow fails because of it).
Desktop Linux has a similar issue.
On desktop Linux, NativeWidgetPrivate::OnRootViewLayout triggers a call
to UpdateMinAndMaxSize. OnRootViewLayout happens during Widget::Init()
but the X11 window is not yet mapped, so this was resulting in a no-op.
For Linux, fix by explicitly calling UpdateMinAndMaxSize after the
window is mapped.
Mac needs to do a similar thing during Init. However, Mac was calling
OnSizeConstraintsChanged() before Widget::Init() had set the non-client
view, so Widget::GetMinimumSize() returned invalid sizes. For Mac, move
the OnSizeConstraintsChanged() call to OnRootViewLayout(), similar to
Linux.
Then, add a cross-platform test. Mac was not clamping to the size
constraints in SetBounds(), so do that.
For the test itself, collapse the testing WidgetDelegates in
widget_unittest.cc into one helper class rather than adding yet another
WidgetDelegate. Then, provide a way to query the OS for the minimum
window size to fill the gaps required for testing the propagation of
size constraints to the window server.
BUG=454698, 447086
Committed: https://crrev.com/c07049637a2deb72869370136c85d70ac608a91a
Cr-Commit-Position: refs/heads/master@{#325538}
Patch Set 1 #Patch Set 2 : GetNativeWidgetMinimumContentSize #Patch Set 3 : SetSize behaviour intentional? #Patch Set 4 : Windows.... you had to be different #Patch Set 5 : Untangle everything #Patch Set 6 : Put it where it actually belongs #Patch Set 7 : Epic cleanup #Patch Set 8 : Cracked the case on Windows #
Messages
Total messages: 12 (6 generated)
|