diff options
Diffstat (limited to 'ash/display')
-rw-r--r-- | ash/display/display_controller.cc | 4 | ||||
-rw-r--r-- | ash/display/display_manager.cc | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 16328fc..2fce25a 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -470,11 +470,11 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) { DCHECK(!root_windows_.empty()); NotifyDisplayConfigurationChanging(); aura::RootWindow* root = AddRootWindowForDisplay(display); - Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); UpdateDisplayBoundsForLayout(); - if (desired_primary_display_id_ == display.id()) SetPrimaryDisplay(display); + + Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); } void DisplayController::OnDisplayRemoved(const gfx::Display& display) { diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index e14d39a..572f91a 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -447,8 +447,14 @@ void DisplayManager::CycleDisplayImpl() { std::vector<gfx::Display> new_displays; new_displays.push_back(DisplayController::GetPrimaryDisplay()); // Add if there is only one display. - if (displays_.size() == 1) - new_displays.push_back(aura::CreateDisplayFromSpec("100+200-500x400")); + if (displays_.size() == 1) { + // Layout the 2nd display below the primary as with the real device. + aura::RootWindow* primary = Shell::GetPrimaryRootWindow(); + gfx::Rect host_bounds = + gfx::Rect(primary->GetHostOrigin(), primary->GetHostSize()); + new_displays.push_back(aura::CreateDisplayFromSpec( + StringPrintf("%d+%d-500x400", host_bounds.x(), host_bounds.bottom()))); + } OnNativeDisplaysChanged(new_displays); } |