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

split view: End split view if window activated in divider snap animation

If a user-positionable window is activated during the divider snap
animation, and if this window is not already snapped in split view, then
split view mode shall end. Regardless of whether the window generally
can be snapped in split view, the cannot snap toast shall not appear in
this workflow.

Test: manual
Bug: 982859
Change-Id: I743c361f59f123e02f76f35033e719a33b66cf70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695966Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676162}
parent 673db747
...@@ -955,6 +955,17 @@ void SplitViewController::OnWindowActivated(ActivationReason reason, ...@@ -955,6 +955,17 @@ void SplitViewController::OnWindowActivated(ActivationReason reason,
return; return;
} }
// If the divider is animating, then |gained_active| cannot be snapped (and is
// not already snapped either, because then we would have bailed out by now).
// Then if |gained_active| is user-positionable, we should end split view
// mode, but the cannot snap toast would be inappropriate because the user
// still might be able to snap |gained_active|.
if (IsDividerAnimating()) {
if (wm::GetWindowState(gained_active)->IsUserPositionable())
EndSplitView(EndReason::kUnsnappableWindowActivated);
return;
}
// If it's a user positionable window but can't be snapped, end split view // If it's a user positionable window but can't be snapped, end split view
// mode and show the cannot snap toast. // mode and show the cannot snap toast.
if (!CanSnapInSplitview(gained_active)) { if (!CanSnapInSplitview(gained_active)) {
......
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