Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 1059853007: Mac/Linux: Ensure window size constraints propagate to the window server during Init (Closed)

Created:
5 years, 8 months ago by tapted
Modified:
5 years, 8 months ago
Reviewers:
Elliot Glaysher, sky
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac/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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+211 lines, -119 lines) Patch
M ui/views/cocoa/bridged_native_widget.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 2 3 4 5 6 2 chunks +41 lines, -11 lines 0 comments Download
M ui/views/test/widget_test.h View 1 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_aura.cc View 1 2 6 2 chunks +26 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_mac.mm View 1 6 1 chunk +5 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/widget/native_widget_mac.mm View 1 2 3 4 5 6 4 chunks +5 lines, -10 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 2 3 4 5 6 7 6 chunks +123 lines, -98 lines 0 comments Download

Messages

Total messages: 12 (6 generated)
tapted
Hi sky - please take a look erg - please take a look for the ...
5 years, 8 months ago (2015-04-16 08:52:42 UTC) #6
Elliot Glaysher
x11 stuff lgtm
5 years, 8 months ago (2015-04-16 18:02:31 UTC) #7
sky
LGTM
5 years, 8 months ago (2015-04-16 19:15:08 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1059853007/220001
5 years, 8 months ago (2015-04-16 23:04:23 UTC) #10
commit-bot: I haz the power
Committed patchset #8 (id:220001)
5 years, 8 months ago (2015-04-16 23:10:32 UTC) #11
commit-bot: I haz the power
5 years, 8 months ago (2015-04-16 23:11:27 UTC) #12
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/c07049637a2deb72869370136c85d70ac608a91a
Cr-Commit-Position: refs/heads/master@{#325538}

Powered by Google App Engine
This is Rietveld 408576698