Index: ash/wm/panels/panel_layout_manager.cc |
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc |
index c4ccd11a3d878a0cd6728166abfa487147f3bfeb..3fff3fc3667c7b046b4ef61788b44cd53faa1dc5 100644 |
--- a/ash/wm/panels/panel_layout_manager.cc |
+++ b/ash/wm/panels/panel_layout_manager.cc |
@@ -13,9 +13,11 @@ |
#include "ash/shelf/shelf_types.h" |
#include "ash/shelf/shelf_widget.h" |
#include "ash/shell.h" |
+#include "ash/shell_window_ids.h" |
#include "ash/wm/frame_painter.h" |
#include "ash/wm/property_util.h" |
#include "ash/wm/window_animations.h" |
+#include "ash/wm/window_properties.h" |
#include "ash/wm/window_util.h" |
#include "base/auto_reset.h" |
#include "base/bind.h" |
@@ -328,6 +330,17 @@ void PanelLayoutManager::OnWindowResized() { |
void PanelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { |
if (child->type() == aura::client::WINDOW_TYPE_POPUP) |
return; |
+ if (!child->GetProperty(kPanelAttachedKey)) { |
+ // This should only happen when a window is added to panel container as a |
+ // result of bounds change from within the application during a drag. |
+ // If so we have already stopped the drag and should reparent the panel |
+ // back to appropriate container and ignore it. |
flackr
2013/06/20 23:00:57
Add TODO to remove this, with a reference to the g
varkha
2013/06/20 23:10:04
Done.
|
+ child->SetDefaultParentByRootWindow( |
+ child->GetRootWindow(), |
+ child->GetRootWindow()->GetBoundsInScreen()); |
+ DCHECK(child->parent()->id() != kShellWindowId_PanelContainer); |
+ return; |
+ } |
PanelInfo panel_info; |
panel_info.window = child; |
panel_info.callout_widget = new PanelCalloutWidget(panel_container_); |