Chromium Code Reviews| 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..d2acef858a6ddcb338c7b153566621b0ceae8232 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,19 @@ 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. |
| + // TODO(varkha): Updating bounds during a drag can cause problems and a more |
| + // general solution is needed. See http://crbug.com/251813 . |
| + child->SetDefaultParentByRootWindow( |
|
flackr
2013/06/21 01:14:48
It makes me uncomfortable that this could cause an
varkha
2013/06/21 01:27:08
Done. Cannot really happen with our current logic
|
| + 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_); |