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

Unified Diff: services/ui/ws/window_manager_state.cc

Issue 2170053003: mash: Don't crash when dragging a window to the side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: services/ui/ws/window_manager_state.cc
diff --git a/services/ui/ws/window_manager_state.cc b/services/ui/ws/window_manager_state.cc
index 4f4d2eeee12330265cfb8169edd7f5c00a0d6dc0..cbec88f4bf3d07554d355b0bf828ed0fe9aa3b49 100644
--- a/services/ui/ws/window_manager_state.cc
+++ b/services/ui/ws/window_manager_state.cc
@@ -496,12 +496,14 @@ ClientSpecificId WindowManagerState::GetEventTargetClientId(
tree = window_server()->GetTreeWithId(window->id().client_id);
}
- const ServerWindow* embed_root =
- tree->HasRoot(window) ? window : GetEmbedRoot(window);
- while (tree && tree->embedder_intercepts_events()) {
- DCHECK(tree->HasRoot(embed_root));
- tree = window_server()->GetTreeWithId(embed_root->id().client_id);
- embed_root = GetEmbedRoot(embed_root);
+ if (tree) {
+ const ServerWindow* embed_root =
+ tree->HasRoot(window) ? window : GetEmbedRoot(window);
+ while (tree && tree->embedder_intercepts_events()) {
+ DCHECK(tree->HasRoot(embed_root));
+ tree = window_server()->GetTreeWithId(embed_root->id().client_id);
+ embed_root = GetEmbedRoot(embed_root);
+ }
}
if (!tree) {
« 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