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. |