Index: ash/display/window_tree_host_manager.cc |
diff --git a/ash/display/window_tree_host_manager.cc b/ash/display/window_tree_host_manager.cc |
index 358804ac0280a7b0ccecc20b30e24cb3c0b74b49..2408d979d385771ed4f43dce0be2b7841a2c2670 100644 |
--- a/ash/display/window_tree_host_manager.cc |
+++ b/ash/display/window_tree_host_manager.cc |
@@ -328,6 +328,10 @@ int64_t WindowTreeHostManager::GetPrimaryDisplayId() { |
} |
aura::Window* WindowTreeHostManager::GetPrimaryRootWindow() { |
+ // If |primary_tree_host_for_replace_| is set, it means |primary_display_id| |
+ // is kInvalidDisplayId. |
+ if (primary_tree_host_for_replace_) |
+ return GetWindow(primary_tree_host_for_replace_); |
return GetRootWindowForDisplayId(primary_display_id); |
} |