| Index: ash/wm/dock/docked_window_layout_manager.cc
|
| diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
|
| index 0a648a025f748303a10c7c27d0f6a78dfeedee28..469659f3715450d4e41fd5409fd29f506cc0cab8 100644
|
| --- a/ash/wm/dock/docked_window_layout_manager.cc
|
| +++ b/ash/wm/dock/docked_window_layout_manager.cc
|
| @@ -532,8 +532,12 @@ bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
|
| if (!switches::UseDockedWindows())
|
| return false;
|
| // Don't allow interactive docking of windows with transient parents such as
|
| - // modal browser dialogs.
|
| - if (IsPopupOrTransient(window))
|
| + // modal browser dialogs. Prevent docking of panels attached to shelf during
|
| + // the drag.
|
| + wm::WindowState* window_state = wm::GetWindowState(window);
|
| + bool should_attach_to_shelf = window_state->drag_details() &&
|
| + window_state->drag_details()->should_attach_to_shelf;
|
| + if (IsPopupOrTransient(window) || should_attach_to_shelf)
|
| return false;
|
| // If a window is wide and cannot be resized down to maximum width allowed
|
| // then it cannot be docked.
|
| @@ -541,7 +545,7 @@ bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
|
| // they are docked. The size will take effect only once a window is undocked.
|
| // See http://crbug.com/307792.
|
| if (window->bounds().width() > kMaxDockWidth &&
|
| - (!wm::GetWindowState(window)->CanResize() ||
|
| + (!window_state->CanResize() ||
|
| (window->delegate() &&
|
| window->delegate()->GetMinimumSize().width() != 0 &&
|
| window->delegate()->GetMinimumSize().width() > kMaxDockWidth))) {
|
|
|