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

Unified Diff: components/mus/ws/window_manager_state.cc

Issue 1783553004: Fix DCHECK/crash in WindowManagerState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
index 2ae1a24ce0bcd481884120702555e8db3bc334eb..081ca5e021bff0aa9b644ca70b54ab406143fa87 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -275,8 +275,15 @@ void WindowManagerState::DispatchInputEventToWindowImpl(
? connection_manager()->GetTreeWithId(target->id().connection_id)
: connection_manager()->GetTreeWithRoot(target);
if (!tree) {
- DCHECK(!in_nonclient_area);
- tree = connection_manager()->GetTreeWithId(target->id().connection_id);
+ if (in_nonclient_area) {
+ // Being the root of the tree means we may get events outside the bounds
+ // of the platform window. Because the root has a connection id of 0,
+ // no WindowTree is found for it and we have to special case it here.
+ DCHECK_EQ(target, root_.get());
+ tree = tree_;
+ } else {
+ tree = connection_manager()->GetTreeWithId(target->id().connection_id);
+ }
}
// TOOD(sad): Adjust this delay, possibly make this dynamic.
« 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