Commit 93859a4c authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

Tab dragging: the dragged tab window should be able to drop into overview.

When dragging a tab out of a snapped browser window to drop into
overview, it should be able to merge the tab window into the overview.
However, with the recent change to always update the dragged window's
bounds before adding it to overview, it's possible that the dragged
window is merged back into its source window due to its bounds change.
To avoid this, we temmrarily disable the dragged window's ability to
merge into another window when updating the dragged window's bounds and
restore its ability after adding it to overview.

Bug: 878191
Change-Id: I219517b19f42395ca8a0c095d7313734358e159e
Reviewed-on: https://chromium-review.googlesource.com/1192357Reviewed-by: default avatarMin Chen <minch@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586733}
parent 0711fb3f
...@@ -737,6 +737,11 @@ void WindowGrid::OnWindowDragEnded(aura::Window* dragged_window, ...@@ -737,6 +737,11 @@ void WindowGrid::OnWindowDragEnded(aura::Window* dragged_window,
// dragged window might have resized to a smaller size if the drag // dragged window might have resized to a smaller size if the drag
// happens on tab(s). // happens on tab(s).
const gfx::Rect old_bounds = dragged_window->bounds(); const gfx::Rect old_bounds = dragged_window->bounds();
// We need to temporarily disable the dragged window's ability to merge
// into another window when changing the dragged window's bounds, so that
// the dragged window doesn't merge into another window because of its
// changed bounds.
dragged_window->SetProperty(ash::kCanAttachToAnotherWindowKey, false);
TabletModeWindowState::UpdateWindowPosition( TabletModeWindowState::UpdateWindowPosition(
wm::GetWindowState(dragged_window)); wm::GetWindowState(dragged_window));
const gfx::Rect new_bounds = dragged_window->bounds(); const gfx::Rect new_bounds = dragged_window->bounds();
...@@ -750,6 +755,7 @@ void WindowGrid::OnWindowDragEnded(aura::Window* dragged_window, ...@@ -750,6 +755,7 @@ void WindowGrid::OnWindowDragEnded(aura::Window* dragged_window,
window_selector_->AddItem(dragged_window, /*reposition=*/false, window_selector_->AddItem(dragged_window, /*reposition=*/false,
/*animate=*/false); /*animate=*/false);
dragged_window->ClearProperty(ash::kCanAttachToAnotherWindowKey);
} }
SelectedWindow()->set_selected(false); SelectedWindow()->set_selected(false);
selection_widget_.reset(); selection_widget_.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment