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

Use TargetBounds to compute RestoreBounds

Toggle maximize should use the target bounds so that it can restore
the correct orginal bounds. (although this is probably less important
because it's near impossible for a user to trigger this while animating)

WindowResizer shoud use just bounds(), because that's where a use captured
the window and started dragging.

Bug: None
Change-Id: I5e25805de92cc2afc616fda6068ec6ac50ecf700
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559350Reviewed-by: default avatarEliot Courtney <edcourtney@chromium.org>
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649128}
parent fe600eae
......@@ -297,7 +297,7 @@ void DefaultState::HandleCompoundEvents(WindowState* window_state,
gfx::Rect new_bounds(work_area.x(), window->bounds().y(),
work_area.width(), window->bounds().height());
gfx::Rect restore_bounds = window->bounds();
gfx::Rect restore_bounds = window->GetTargetBounds();
if (window_state->IsSnapped()) {
window_state->SetRestoreBoundsInParent(new_bounds);
window_state->Restore();
......
......@@ -689,6 +689,8 @@ WorkspaceWindowResizer::WorkspaceWindowResizer(
}
instance = this;
// Use |bounds()| instead of |GetTargetBounds()| because that's the position a
// user captured the window.
pre_drag_window_bounds_ = window_state->window()->bounds();
window_state->OnDragStarted(details().window_component);
......
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