| Index: ash/mus/bridge/wm_shell_mus.cc
|
| diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
|
| index e13fbffd63d95fb9001c6973fbd5ea26556ea3b3..0e71dfb3a23006e9f77be9c0e85739ec5c36aca8 100644
|
| --- a/ash/mus/bridge/wm_shell_mus.cc
|
| +++ b/ash/mus/bridge/wm_shell_mus.cc
|
| @@ -155,6 +155,9 @@ WmShellMus* WmShellMus::Get() {
|
| void WmShellMus::AddRootWindowController(
|
| WmRootWindowControllerMus* controller) {
|
| root_window_controllers_.push_back(controller);
|
| + // The first root window will be the initial root for new windows.
|
| + if (!GetRootWindowForNewWindows())
|
| + set_root_window_for_new_windows(controller->GetWindow());
|
| }
|
|
|
| void WmShellMus::RemoveRootWindowController(
|
| @@ -206,11 +209,6 @@ WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) {
|
| return GetRootWindowControllerWithDisplayId(display_id)->GetWindow();
|
| }
|
|
|
| -WmWindow* WmShellMus::GetRootWindowForNewWindows() {
|
| - NOTIMPLEMENTED();
|
| - return root_window_controllers_[0]->GetWindow();
|
| -}
|
| -
|
| const DisplayInfo& WmShellMus::GetDisplayInfo(int64_t display_id) const {
|
| NOTIMPLEMENTED();
|
| static DisplayInfo fake_info;
|
| @@ -357,8 +355,11 @@ bool WmShellMus::IsActivationParent(ui::Window* window) {
|
| // TODO: support OnAttemptToReactivateWindow, http://crbug.com/615114.
|
| void WmShellMus::OnWindowTreeFocusChanged(ui::Window* gained_focus,
|
| ui::Window* lost_focus) {
|
| - WmWindowMus* gained_active = GetToplevelAncestor(gained_focus);
|
| - WmWindowMus* lost_active = GetToplevelAncestor(gained_focus);
|
| + WmWindow* gained_active = GetToplevelAncestor(gained_focus);
|
| + if (gained_active)
|
| + set_root_window_for_new_windows(gained_active->GetRootWindow());
|
| +
|
| + WmWindow* lost_active = GetToplevelAncestor(gained_focus);
|
| if (gained_active == lost_active)
|
| return;
|
|
|
|
|