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

Unified Diff: components/exo/shell_surface.cc

Issue 2179243002: exo: Set widget parent to target root window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix incorrect root window for popups Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 0f0c8a65bdda247291e03b7cdd5f4d8991ffff57..f83d7ad00c9c1c0762e79d2b2c18e8f31366de74 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -887,8 +887,9 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
params.show_state = show_state;
- params.parent =
- ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), container_);
+ // Make shell surface a transient child if |parent_| has been set.
+ params.parent = parent_ ? parent_ :
reveman 2016/07/29 18:27:07 Pretty sure this will break xdg shell modal dialog
oshima 2016/07/29 20:35:58 That's still not right. Let's discuss offline.
Dominik Laskowski 2016/07/29 20:37:09 Unless |params.child| is true, Widget::Init makes
+ ash::Shell::GetContainer(ash::Shell::GetTargetRootWindow(), container_);
params.bounds = initial_bounds_;
bool activatable = activatable_;
// ShellSurfaces in system modal container are only activatable if input
@@ -924,10 +925,6 @@ void ShellSurface::CreateShellSurfaceWidget(ui::WindowShowState show_state) {
widget_->set_movement_disabled(!initial_bounds_.IsEmpty());
window_state->set_ignore_keyboard_bounds_change(!initial_bounds_.IsEmpty());
- // Make shell surface a transient child if |parent_| has been set.
- if (parent_)
- wm::AddTransientChild(parent_, window);
-
// Allow Ash to manage the position of a top-level shell surfaces if show
// state is one that allows auto positioning and |initial_bounds_| has
// not been set.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698