Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2321)

Unified Diff: ash/wm/panels/panel_layout_manager.cc

Issue 17431003: Dragging panels near screen edge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dragging panels near screen edge (comments) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/panels/panel_window_resizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « no previous file | ash/wm/panels/panel_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698