Skip to content

Commit

Permalink
Undock window if a window is maximized while being dragged
Browse files Browse the repository at this point in the history
BUG=338235
TEST=DockedWindowResizerTest.MaximizedDuringDrag

Review URL: https://codereview.chromium.org/148063003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249042 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkotwicz@chromium.org committed Feb 5, 2014
1 parent cbd5167 commit 6b158a9
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 46 deletions.
10 changes: 10 additions & 0 deletions ash/wm/dock/docked_window_resizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ void DockedWindowResizer::FinishedDragging(
const bool is_resized =
(details().bounds_change & WindowResizer::kBoundsChange_Resizes) != 0;

// Undock the window if it is not in the normal or minimized show type. This
// happens if a user snaps or maximizes a window using a keyboard shortcut
// while it is being dragged.
if (window_state_->IsSnapped()) {
is_docked_ = false;
} else if (!window_state_->IsMinimized() &&
!window_state_->IsNormalShowState()) {
is_docked_ = false;
}

// When drag is completed the dragged docked window is resized to the bounds
// calculated by the layout manager that conform to other docked windows.
if (!is_attached_panel && is_docked_ && !is_resized) {
Expand Down
Loading

0 comments on commit 6b158a9

Please sign in to comment.