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

Unified Diff: ash/common/wm/overview/window_selector_item.cc

Issue 2441813002: [ash-md] Prevents a crash when entering overview mode while dragging a window (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/overview/window_selector_item.cc
diff --git a/ash/common/wm/overview/window_selector_item.cc b/ash/common/wm/overview/window_selector_item.cc
index 9eada970ce3163e80b5114ed1d10b4d0cc42820a..c639777d50293e9fa11ae3404357d01814920adf 100644
--- a/ash/common/wm/overview/window_selector_item.cc
+++ b/ash/common/wm/overview/window_selector_item.cc
@@ -427,8 +427,15 @@ void WindowSelectorItem::Shutdown() {
// gradual upon exiting the overview mode.
WmWindow* label_window =
WmLookup::Get()->GetWindowForWidget(window_label_.get());
- label_window->GetParent()->StackChildAbove(label_window,
- transform_window_.window());
+
+ // |label_window| was originally created in the same container as the
+ // |transform_window_| but when closing overview the |transform_window_|
+ // could have been reparented if a drag was active. Only change stacking
+ // if the windows still belong to the same container.
+ if (label_window->GetParent() == transform_window_.window()->GetParent()) {
tdanderson 2016/10/20 21:09:33 For my own learning, in general must two windows i
varkha 2016/10/20 23:54:40 Yes the two windows in the same container have the
+ label_window->GetParent()->StackChildAbove(label_window,
+ transform_window_.window());
+ }
}
if (background_view_) {
background_view_->OnItemRestored();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698