Chromium Code Reviews| Index: ash/wm/dock/docked_window_resizer.cc |
| diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc |
| index 14b58d408fe53eb12eca8c96538a33b537877fe6..1a32a198b7d52f6a52ba73cc0dcfcb53e6d462b9 100644 |
| --- a/ash/wm/dock/docked_window_resizer.cc |
| +++ b/ash/wm/dock/docked_window_resizer.cc |
| @@ -15,6 +15,7 @@ |
| #include "ash/wm/dock/docked_window_layout_manager.h" |
| #include "ash/wm/window_state.h" |
| #include "ash/wm/window_util.h" |
| +#include "ash/wm/wm_event.h" |
| #include "ash/wm/workspace/magnetism_matcher.h" |
| #include "ash/wm/workspace/workspace_window_resizer.h" |
| #include "base/command_line.h" |
| @@ -222,7 +223,8 @@ void DockedWindowResizer::FinishedDragging( |
| // Undock the window if it is not in the normal or minimized state type. This |
| // happens if a user snaps or maximizes a window using a keyboard shortcut |
| // while it is being dragged. |
| - if (!window_state_->IsMinimized() && !window_state_->IsNormalStateType()) |
| + if (!window_state_->IsMinimized() && !window_state_->IsDocked() && |
|
varkha
2014/09/29 18:59:28
Can you comment why this change is necessary?
dtapuska
2014/09/29 20:59:57
Previously docked windows were normal state type w
|
| + !window_state_->IsNormalStateType()) |
| is_docked_ = false; |
| // When drag is completed the dragged docked window is resized to the bounds |
| @@ -315,6 +317,16 @@ DockedAction DockedWindowResizer::MaybeReparentWindowOnDragCompletion( |
| wm::GetWindowState(window)->set_bounds_changed_by_user( |
| was_docked_ && (is_resized || was_bounds_changed_by_user_)); |
| } |
| + |
| + if (action == DOCKED_ACTION_DOCK) { |
| + const wm::WMEvent event(wm::WM_EVENT_DOCK); |
| + window_state_->OnWMEvent(&event); |
| + } else if (wm::GetWindowState(window)->IsDocked() && |
| + action == DOCKED_ACTION_UNDOCK) { |
| + const wm::WMEvent event(wm::WM_EVENT_NORMAL); |
| + window_state_->OnWMEvent(&event); |
| + } |
| + |
| return action; |
| } |