Index: services/ui/ws/window_server.cc |
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc |
index 2aaa85eb5d3735878584d027b3735bc6883e6e48..322cb0ce6bbd4d3024a18f7a0086dd81b07a1abd 100644 |
--- a/services/ui/ws/window_server.cc |
+++ b/services/ui/ws/window_server.cc |
@@ -882,10 +882,9 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { |
HandleTemporaryReferenceForNewSurface(surface_info.id(), window); |
- if (!window->parent()) |
- return; |
- |
- WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); |
+ // We always use the owner of the window's id (even for an embedded window), |
+ // because an embedded window's id is allocated by the parent's window tree. |
+ WindowTree* window_tree = GetTreeWithId(window->id().client_id); |
if (window_tree) |
window_tree->ProcessWindowSurfaceChanged(window, surface_info); |
} |