Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ash / wm / drag_details.cc
index 5fa6d0a..67bbedc 100644 (file)
@@ -45,7 +45,8 @@ DragDetails::DragDetails(aura::Window* window,
                          const gfx::Point& location,
                          int window_component,
                          aura::client::WindowMoveSource source)
-    : initial_bounds_in_parent(window->bounds()),
+    : initial_state_type(wm::GetWindowState(window)->GetStateType()),
+      initial_bounds_in_parent(window->bounds()),
       initial_location_in_parent(location),
       initial_opacity(window->layer()->opacity()),
       window_component(window_component),
@@ -59,13 +60,13 @@ DragDetails::DragDetails(aura::Window* window,
       is_resizable(bounds_change != WindowResizer::kBoundsChangeDirection_None),
       source(source),
       should_attach_to_shelf(window->type() == ui::wm::WINDOW_TYPE_PANEL &&
-                             wm::GetWindowState(window)->panel_attached()),
-      window_resizer(NULL) {
+                             wm::GetWindowState(window)->panel_attached()) {
   wm::WindowState* window_state = wm::GetWindowState(window);
-  if (window_state->IsNormalShowState() &&
+  if ((window_state->IsNormalOrSnapped() || window_state->IsDocked()) &&
       window_state->HasRestoreBounds() &&
-      window_component == HTCAPTION)
+      window_component == HTCAPTION) {
     restore_bounds = window_state->GetRestoreBoundsInScreen();
+  }
 }
 
 DragDetails::~DragDetails() {