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

Unified Diff: ui/views/widget/native_widget_mac.mm

Issue 1059853007: Mac/Linux: Ensure window size constraints propagate to the window server during Init (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cracked the case on Windows Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac.mm
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 8c3daaf46e60bf7433bd58e7c3388a20c74f99ff..ca8fcb64b12697c0465e57238dd512b3adfb3a02 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -34,12 +34,6 @@ NSInteger StyleMaskForParams(const Widget::InitParams& params) {
return NSBorderlessWindowMask;
}
-gfx::Size WindowSizeForClientAreaSize(NSWindow* window, const gfx::Size& size) {
- NSRect content_rect = NSMakeRect(0, 0, size.width(), size.height());
- NSRect frame_rect = [window frameRectForContentRect:content_rect];
- return gfx::Size(NSWidth(frame_rect), NSHeight(frame_rect));
-}
-
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -91,8 +85,6 @@ void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) {
delegate_->OnNativeWidgetCreated(true);
- OnSizeConstraintsChanged();
-
bridge_->SetFocusManager(GetWidget()->GetFocusManager());
DCHECK(GetWidget()->GetRootView());
@@ -206,7 +198,8 @@ ui::InputMethod* NativeWidgetMac::GetHostInputMethod() {
}
void NativeWidgetMac::CenterWindow(const gfx::Size& size) {
- SetSize(WindowSizeForClientAreaSize(GetNativeWindow(), size));
+ SetSize(
+ BridgedNativeWidget::GetWindowSizeForClientSize(GetNativeWindow(), size));
// Note that this is not the precise center of screen, but it is the standard
// location for windows like dialogs to appear on screen for Mac.
// TODO(tapted): If there is a parent window, center in that instead.
@@ -515,7 +508,9 @@ ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const {
}
void NativeWidgetMac::OnRootViewLayout() {
- NOTIMPLEMENTED();
+ // Ensure possible changes to the non-client view (e.g. Minimum/Maximum size)
+ // propagate through to the NSWindow properties.
+ OnSizeConstraintsChanged();
}
bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const {
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698