Chromium Code Reviews| 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 bfce92136a3e543ab7ce4bb89e6533b7ddb9f097..3b78af79b5b95ec93a62a891df58431c4e1a328f 100644 |
| --- a/ui/views/mus/native_widget_mus.cc |
| +++ b/ui/views/mus/native_widget_mus.cc |
| @@ -775,17 +775,20 @@ void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) { |
| content_->set_ignore_events(!params.accept_events); |
| hosted_window->AddChild(content_); |
| + if (params.parent_mus) |
|
mfomitchev
2016/11/07 18:19:23
Can we make it so we only do AddChild once? Someth
thanhph
2016/11/07 19:50:56
Thanks. I also add the if condition to prevent SEG
mfomitchev
2016/11/07 20:16:47
Cool, thanks!
|
| + params.parent_mus->AddChild(window_); |
| + |
| // Set-up transiency if appropriate. |
| if (params.parent && !params.child) { |
| aura::Window* parent_root = params.parent->GetRootWindow(); |
| ui::Window* parent_mus = parent_root->GetProperty(kMusWindow); |
| - if (parent_mus) |
| + if (parent_mus) { |
| parent_mus->AddTransientWindow(window_); |
| + if (!params.parent_mus) |
| + parent_mus->AddChild(window_); |
| + } |
| } |
| - if (params.parent_mus) |
| - params.parent_mus->AddChild(window_); |
| - |
| // TODO(sky): deal with show state. |
| if (!params.bounds.size().IsEmpty()) |
| SetBounds(params.bounds); |