Index: ash/display/display_controller.cc |
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc |
index 4044fe76464973527bd587b74faa68f5f90330be..8d43b3f67c24004b29c823136fec259a1e39621f 100644 |
--- a/ash/display/display_controller.cc |
+++ b/ash/display/display_controller.cc |
@@ -17,6 +17,8 @@ |
#include "ash/host/ash_window_tree_host.h" |
#include "ash/host/ash_window_tree_host_init_params.h" |
#include "ash/host/root_window_transformer.h" |
+#include "ash/magnifier/magnification_controller.h" |
+#include "ash/magnifier/partial_magnification_controller.h" |
#include "ash/root_window_controller.h" |
#include "ash/root_window_settings.h" |
#include "ash/screen_util.h" |
@@ -366,9 +368,10 @@ aura::Window* DisplayController::GetRootWindowForDisplayId(int64 id) { |
} |
AshWindowTreeHost* DisplayController::GetAshWindowTreeHostForDisplayId( |
- int64 id) { |
- CHECK_EQ(1u, window_tree_hosts_.count(id)); |
- return window_tree_hosts_[id]; |
+ int64 display_id) { |
+ CHECK_EQ(1u, window_tree_hosts_.count(display_id)) |
+ << "display id = " << display_id; |
+ return window_tree_hosts_[display_id]; |
} |
void DisplayController::CloseChildWindows() { |
@@ -584,6 +587,7 @@ void DisplayController::UpdateMouseLocationAfterDisplayChange() { |
&target_location_in_root); |
#if defined(USE_OZONE) |
+ LOG(ERROR) << "Start OZONE"; |
gfx::Point target_location_in_screen = target_location_in_root; |
::wm::ConvertPointToScreen(dst_root_window, &target_location_in_screen); |
const gfx::Display& target_display = |
@@ -615,6 +619,7 @@ void DisplayController::UpdateMouseLocationAfterDisplayChange() { |
dst_root_window->GetHost()->dispatcher()->OnCursorMovedToRootLocation( |
target_location_in_root); |
} |
+ LOG(ERROR) << "END OZONE"; |
#else |
dst_root_window->MoveCursorTo(target_location_in_root); |
#endif |
@@ -640,6 +645,14 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) { |
AddWindowTreeHostForDisplay(display, AshWindowTreeHostInitParams()); |
RootWindowController::CreateForSecondaryDisplay(ash_host); |
+ // Magnifier controllers keep pointers to the current root window. |
+ // Update them here to avoid accessing them later. |
+ Shell::GetInstance()->magnification_controller()->SwitchTargetRootWindow( |
+ ash_host->AsWindowTreeHost()->window(), false); |
+ Shell::GetInstance() |
+ ->partial_magnification_controller() |
+ ->SwitchTargetRootWindow(ash_host->AsWindowTreeHost()->window()); |
+ |
if (primary_tree_host_for_replace_) { |
AshWindowTreeHost* to_delete = primary_tree_host_for_replace_; |
primary_tree_host_for_replace_ = nullptr; |