Commit c48c5fbf authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Allow smooth resizing when multi resizing windows

Bug: 954510
Test: covered by unittest
Change-Id: I954bd6b9b928b5d765e0d646cf77ebb6fca3745a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574285Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652553}
parent 8c874906
...@@ -278,6 +278,17 @@ TEST_F(MultiWindowResizeControllerTest, Drag) { ...@@ -278,6 +278,17 @@ TEST_F(MultiWindowResizeControllerTest, Drag) {
EXPECT_TRUE(IsShowing()); EXPECT_TRUE(IsShowing());
EXPECT_EQ(gfx::Rect(0, 0, 110, 100), w1->bounds()); EXPECT_EQ(gfx::Rect(0, 0, 110, 100), w1->bounds());
EXPECT_EQ(gfx::Rect(110, 0, 100, 100), w2->bounds()); EXPECT_EQ(gfx::Rect(110, 0, 100, 100), w2->bounds());
// It should be possible to move 1px.
bounds = resize_widget()->GetWindowBoundsInScreen();
generator->MoveMouseTo(bounds.x() + 1, bounds.y() + 1);
generator->PressLeftButton();
generator->MoveMouseBy(1, 0);
generator->ReleaseLeftButton();
EXPECT_EQ(gfx::Rect(0, 0, 111, 100), w1->bounds());
EXPECT_EQ(gfx::Rect(111, 0, 100, 100), w2->bounds());
} }
// Makes sure three windows are picked up. // Makes sure three windows are picked up.
......
...@@ -905,6 +905,10 @@ bool WorkspaceWindowResizer::UpdateMagnetismWindow( ...@@ -905,6 +905,10 @@ bool WorkspaceWindowResizer::UpdateMagnetismWindow(
const std::vector<aura::Window*>& children = container->children(); const std::vector<aura::Window*>& children = container->children();
for (auto i = children.rbegin(); for (auto i = children.rbegin();
i != children.rend() && !matcher.AreEdgesObscured(); ++i) { i != children.rend() && !matcher.AreEdgesObscured(); ++i) {
// Ignore already attached windows.
if (base::ContainsValue(attached_windows_, *i))
continue;
wm::WindowState* other_state = wm::GetWindowState(*i); wm::WindowState* other_state = wm::GetWindowState(*i);
if (other_state->window() == GetTarget() || if (other_state->window() == GetTarget() ||
!other_state->window()->IsVisible() || !other_state->window()->IsVisible() ||
......
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