Commit 846a59b9 authored by estade's avatar estade Committed by Commit bot

CrOS Window cycle ui - set widget bounds with initparams to avoid extra

resizing.

This also requires changing Widget::SetInitialBoundsForFramelessWindows,
which inexplicably constrains the bounds to a rectangle that is smaller
than the work area.

BUG=646418

Review-Url: https://codereview.chromium.org/2337213002
Cr-Commit-Position: refs/heads/master@{#418446}
parent 57d29316
...@@ -612,14 +612,14 @@ void WindowCycleList::InitWindowCycleView() { ...@@ -612,14 +612,14 @@ void WindowCycleList::InitWindowCycleView() {
WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows(); WmWindow* root_window = WmShell::Get()->GetRootWindowForNewWindows();
root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
widget, kShellWindowId_OverlayContainer, &params); widget, kShellWindowId_OverlayContainer, &params);
widget->Init(params);
screen_observer_.Add(display::Screen::GetScreen());
gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds(); gfx::Rect widget_rect = root_window->GetDisplayNearestWindow().bounds();
int widget_height = cycle_view_->GetPreferredSize().height(); int widget_height = cycle_view_->GetPreferredSize().height();
widget_rect.set_y((widget_rect.height() - widget_height) / 2); widget_rect.set_y((widget_rect.height() - widget_height) / 2);
widget_rect.set_height(widget_height); widget_rect.set_height(widget_height);
widget->SetBounds(widget_rect); params.bounds = widget_rect;
widget->Init(params);
screen_observer_.Add(display::Screen::GetScreen());
widget->Show(); widget->Show();
widget->SetCapture(cycle_view_); widget->SetCapture(cycle_view_);
widget->set_auto_release_capture(false); widget->set_auto_release_capture(false);
......
...@@ -1456,7 +1456,7 @@ void Widget::SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds) { ...@@ -1456,7 +1456,7 @@ void Widget::SetInitialBoundsForFramelessWindow(const gfx::Rect& bounds) {
native_widget_->CenterWindow(size); native_widget_->CenterWindow(size);
} else { } else {
// Use the supplied initial bounds. // Use the supplied initial bounds.
SetBoundsConstrained(bounds); SetBounds(bounds);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment