summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-14 00:47:41 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-14 00:47:41 +0000
commita984ff022a7116c06ae83dbb2449b10d14dc35c9 (patch)
treefb9f6d71dcf586e628057937d6b31596552d2bfa
parent26f65e594c7b67449df7474567d4d92da57a6e35 (diff)
downloadchromium_src-a984ff022a7116c06ae83dbb2449b10d14dc35c9.zip
chromium_src-a984ff022a7116c06ae83dbb2449b10d14dc35c9.tar.gz
chromium_src-a984ff022a7116c06ae83dbb2449b10d14dc35c9.tar.bz2
ash: Fix startup crash with multimonitor and hidden launcher
Ash crashes if it starts up with the launcher set to autohide, two monitors attached, and the secondary monitor higher resolution than the primary. This occurs because the launcher is created before the secondary monitor is initialized. In particular, the secondary monitor's x/y location has not been set, which Ash interprets at two monitors with overlapping bounds like 0,0+1024,768 and 0,0+1920,1080. Since the hidden launcher's bounds extend off the bottom of the primary monitor Ash sees overlap with the secondary monitor and tries to place the launcher on the not-fully-initialized secondary. Fixed by moving secondary monitor initialization before launcher creation. Original patch by oshima, http://codereview.chromium.org/10911191/ BUG=148778 TEST=Set launcher to auto-hide, shut down Chromebook, plug in external monitor taller than 800 pixels, power on and log in. Chrome should not crash. Review URL: https://chromiumcodereview.appspot.com/10911295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156699 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/display/screen_position_controller.cc1
-rw-r--r--ash/shell.cc5
2 files changed, 4 insertions, 2 deletions
diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc
index 34b711f..c453c7b 100644
--- a/ash/display/screen_position_controller.cc
+++ b/ash/display/screen_position_controller.cc
@@ -91,6 +91,7 @@ void ScreenPositionController::SetBounds(aura::Window* window,
aura::RootWindow* dst_root =
Shell::GetInstance()->display_controller()->GetRootWindowForDisplayId(
display.id());
+ DCHECK(dst_root);
aura::Window* dst_container = NULL;
if (dst_root != window->GetRootWindow()) {
int container_id = window->parent()->id();
diff --git a/ash/shell.cc b/ash/shell.cc
index d331778..69008b8 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -477,14 +477,15 @@ void Shell::Init() {
shadow_controller_.reset(new internal::ShadowController());
}
+ // Launcher must be created after secondary displays are initialized.
+ display_controller_->InitSecondaryDisplays();
+
if (!delegate_.get() || delegate_->IsUserLoggedIn())
CreateLauncher();
// Force Layout
root_window_controller->root_window_layout()->OnWindowResized();
- display_controller_->InitSecondaryDisplays();
-
// It needs to be created after OnWindowResized has been called, otherwise the
// widget will not paint when restoring after a browser crash. Also it needs
// to be created after InitSecondaryDisplays() to initialize the wallpapers in