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

overview: Avoid bailing out of UpdateDragIndicatorsAndOverviewGrid

OverviewWindowDragController::UpdateDragIndicatorsAndOverviewGrid()
contains code that bails out if the window cannot be snapped in split
view. So then OverviewSession::RearrangeDuringDrag() does not get
called, and it has responsibility for updating the drop target
background visibility, hence Issue 964469. Also,
OverviewSession::SetSplitViewDragIndicatorsIndicatorState() does not get
called, and it has responsibility for reparenting the split view drag
indicators widget so that it appears on the correct display, meaning
that the present CL is a step toward fixing Issue 961171, although the
present CL certainly does not completely fix Issue 961171.

Test: manual
Bug: 961171, 964469
Change-Id: I95704caacfb315161c9ecf34e3ad55b1c40a8c2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617272Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661078}
parent 602de12d
......@@ -309,27 +309,23 @@ void OverviewWindowDragController::UpdateDragIndicatorsAndOverviewGrid(
if (!ShouldUpdateDragIndicatorsOrSnap(location_in_screen))
return;
// Attempt to update the drag indicators and move the window grid only if the
// window is snappable.
if (!CanSnapInSplitview(item_->GetWindow())) {
snap_position_ = SplitViewController::NONE;
return;
}
snap_position_ = GetSnapPosition(location_in_screen);
IndicatorState indicator_state;
switch (snap_position_) {
case SplitViewController::NONE:
indicator_state = CanSnapInSplitview(item_->GetWindow())
? IndicatorState::kDragArea
: IndicatorState::kCannotSnap;
break;
case SplitViewController::LEFT:
indicator_state = IndicatorState::kPreviewAreaLeft;
break;
case SplitViewController::RIGHT:
indicator_state = IndicatorState::kPreviewAreaRight;
break;
if (CanSnapInSplitview(item_->GetWindow())) {
snap_position_ = GetSnapPosition(location_in_screen);
switch (snap_position_) {
case SplitViewController::NONE:
indicator_state = IndicatorState::kDragArea;
break;
case SplitViewController::LEFT:
indicator_state = IndicatorState::kPreviewAreaLeft;
break;
case SplitViewController::RIGHT:
indicator_state = IndicatorState::kPreviewAreaRight;
break;
}
} else {
snap_position_ = SplitViewController::NONE;
indicator_state = IndicatorState::kCannotSnap;
}
overview_session_->RearrangeDuringDrag(item_->GetWindow(), location_in_screen,
indicator_state);
......
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