| Index: ui/views/mus/native_widget_mus.cc
|
| diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
|
| index 3f2e687781d3d6b8b84772df1b3a4def20fc69e8..7303c7c8a2391e193b7b7279b4dbb5e99b823cfc 100644
|
| --- a/ui/views/mus/native_widget_mus.cc
|
| +++ b/ui/views/mus/native_widget_mus.cc
|
| @@ -711,7 +711,7 @@ std::string NativeWidgetMus::GetWorkspace() const {
|
| }
|
|
|
| void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
|
| - if (!window_tree_host_)
|
| + if (!(window_ && window_tree_host_))
|
| return;
|
|
|
| gfx::Size size(bounds.size());
|
| @@ -721,6 +721,7 @@ void NativeWidgetMus::SetBounds(const gfx::Rect& bounds) {
|
| size.SetToMin(max_size);
|
| size.SetToMax(min_size);
|
| window_tree_host_->SetBounds(gfx::Rect(bounds.origin(), size));
|
| + window_->SetBounds(gfx::Rect(bounds.origin(), size));
|
| }
|
|
|
| void NativeWidgetMus::SetSize(const gfx::Size& size) {
|
| @@ -771,6 +772,7 @@ void NativeWidgetMus::Hide() {
|
| return;
|
|
|
| window_tree_host_->Hide();
|
| + window_->SetVisible(false);
|
| GetNativeWindow()->Hide();
|
| }
|
|
|
| @@ -780,10 +782,11 @@ void NativeWidgetMus::ShowMaximizedWithBounds(
|
| }
|
|
|
| void NativeWidgetMus::ShowWithWindowState(ui::WindowShowState state) {
|
| - if (!window_tree_host_)
|
| + if (!(window_ && window_tree_host_))
|
| return;
|
|
|
| window_tree_host_->Show();
|
| + window_->SetVisible(true);
|
| GetNativeWindow()->Show();
|
| if (native_widget_delegate_->CanActivate()) {
|
| if (state != ui::SHOW_STATE_INACTIVE)
|
| @@ -798,8 +801,8 @@ bool NativeWidgetMus::IsVisible() const {
|
| }
|
|
|
| void NativeWidgetMus::Activate() {
|
| - if (window_tree_host_)
|
| - window_tree_host_->platform_window()->Activate();
|
| + if (window_)
|
| + window_->SetFocus();
|
| }
|
|
|
| void NativeWidgetMus::Deactivate() {
|
| @@ -1121,9 +1124,11 @@ void NativeWidgetMus::OnMusWindowVisibilityChanging(mus::Window* window) {
|
| void NativeWidgetMus::OnMusWindowVisibilityChanged(mus::Window* window) {
|
| if (window->visible()) {
|
| window_tree_host_->Show();
|
| + window_->SetVisible(true);
|
| GetNativeWindow()->Show();
|
| } else {
|
| window_tree_host_->Hide();
|
| + window_->SetVisible(false);
|
| GetNativeWindow()->Hide();
|
| }
|
| native_widget_delegate_->OnNativeWidgetVisibilityChanged(window->visible());
|
|
|