summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller.cc
diff options
context:
space:
mode:
authorvarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 01:24:21 +0000
committervarkha@chromium.org <varkha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 01:24:21 +0000
commit8663b7a6af87566a98eedebcb5d9557aa66affb4 (patch)
tree5e334d4970c94b38ec67e3ae5d37fb5fe278a1ef /ash/root_window_controller.cc
parent57d029dbc30fea166f628864a232bae1f36151aa (diff)
downloadchromium_src-8663b7a6af87566a98eedebcb5d9557aa66affb4.zip
chromium_src-8663b7a6af87566a98eedebcb5d9557aa66affb4.tar.gz
chromium_src-8663b7a6af87566a98eedebcb5d9557aa66affb4.tar.bz2
Avoids overwriting the bounds of docked windows moved to another display. The bounds are changed when the window is added to docked container in DockedWindowLayoutManager::OnWindowAddedToLayout and should not be reset to the coordinates that were correct in the old display.
BUG=334313 TEST=ash_unittests --gtest_filter=*DisplayDisconnectionMovesDocked* TEST=Manual on a Chromebook. Follow the repro steps and verify that a docked window is properly docked in the new display after external display disconnection. Review URL: https://codereview.chromium.org/134643018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r--ash/root_window_controller.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 3b718fc..8a52e32 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -120,8 +120,8 @@ void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
gfx::Rect restore_bounds;
bool has_restore_bounds = state->HasRestoreBounds();
- // TODO(oshima): snapped state should be handled by the layout manager.
- bool update_bounds = state->IsNormalShowState() || state->IsMinimized();
+ bool update_bounds = (state->IsNormalShowState() || state->IsMinimized()) &&
+ new_parent->id() != internal::kShellWindowId_DockedContainer;
gfx::Rect local_bounds;
if (update_bounds) {
local_bounds = state->window()->bounds();
@@ -135,6 +135,7 @@ void ReparentWindow(aura::Window* window, aura::Window* new_parent) {
new_parent->AddChild(window);
+ // Docked windows have bounds handled by the layout manager in AddChild().
if (update_bounds)
window->SetBounds(local_bounds);