Commit 10387294 authored by Avery Musbach's avatar Avery Musbach Committed by Commit Bot

split view: Fix split view drag indicators in multi-display dragging

Multi-display dragging was not accounted for in
https://chromium-review.googlesource.com/c/chromium/src/+/2039140

Test: ash_unittests All/SplitViewOverviewSessionInClamshellTestMultiDisplayOnly.MultiDisplayDragging/0
Bug: 961170
Change-Id: I9db1c280702e0197d24d4e18c8d4c7d441999061
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055808Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741494}
parent 5e060961
......@@ -6347,6 +6347,19 @@ TEST_P(SplitViewOverviewSessionInClamshellTestMultiDisplayOnly,
/*window_for_minimum_size=*/nullptr),
grid_on_root2->bounds());
const gfx::PointF root2_left_snap_point_away_from_edge(816.f, 300.f);
overview_session()->Drag(item1, root2_left_snap_point_away_from_edge);
EXPECT_EQ(SplitViewDragIndicators::WindowDraggingState::kOtherDisplay,
indicators_on_root1->current_window_dragging_state());
EXPECT_EQ(display_with_root1.work_area(), grid_on_root1->bounds());
EXPECT_EQ(SplitViewDragIndicators::WindowDraggingState::kToSnapLeft,
indicators_on_root2->current_window_dragging_state());
EXPECT_EQ(
SplitViewController::Get(root_windows[1])
->GetSnappedWindowBoundsInScreen(SplitViewController::RIGHT,
/*window_for_minimum_size=*/nullptr),
grid_on_root2->bounds());
const gfx::PointF root2_right_snap_point(1599.f, 300.f);
overview_session()->Drag(item1, root2_right_snap_point);
EXPECT_EQ(SplitViewDragIndicators::WindowDraggingState::kOtherDisplay,
......
......@@ -476,7 +476,7 @@ SplitViewController::SnapPosition GetSnapPosition(
drag_end_near_edge = true;
}
if (!drag_end_near_edge) {
if (!drag_end_near_edge && window->GetRootWindow() == root_window) {
// Check how far the window has been dragged.
const auto distance = location_in_screen - initial_location_in_screen;
const int primary_axis_distance = horizontal ? distance.x() : distance.y();
......
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