diff options
-rw-r--r-- | ui/views/widget/native_widget_aura.cc | 6 | ||||
-rw-r--r-- | ui/views/widget/widget.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index b00f2ff..c98ed3d 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -108,11 +108,14 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { gfx::Rect window_bounds = params.bounds; gfx::NativeView parent = params.parent; + gfx::NativeView context = params.context; if (!params.child) { // Set up the transient child before the window is added. This way the // LayoutManager knows the window has a transient parent. if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { parent->AddTransientChild(window_); + if (!context) + context = parent; parent = NULL; } // SetAlwaysOnTop before SetParent so that always-on-top container is used. @@ -138,8 +141,7 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) { // TODO(erg): Remove this NULL check once we've made everything in views // actually pass us a context. - aura::RootWindow* root_window = - params.context ? params.context->GetRootWindow() : NULL; + aura::RootWindow* root_window = context ? context->GetRootWindow() : NULL; window_->SetDefaultParentByRootWindow(root_window, window_bounds); } diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index b8511ff..27a2858 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h @@ -191,7 +191,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // Only used by NativeWidgetAura. Specifies the type of layer for the // aura::Window. Default is LAYER_TEXTURED. ui::LayerType layer_type; - // Only used by Aura. Provides a context window whose RootWindow we be + // Only used by Aura. Provides a context window whose RootWindow is // consulted during widget creation to determine where in the Window // hierarchy this widget should be placed. (This is separate from |parent|; // if you pass a RootWindow to |parent|, your window will be parented to |