Index: services/ui/ws/window_server.cc |
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc |
index a1a67187ffb9ada208d3a6b522edd8f6c0aed92e..b7864006819e66d98a91c8ccd701ecf735e997fb 100644 |
--- a/services/ui/ws/window_server.cc |
+++ b/services/ui/ws/window_server.cc |
@@ -193,6 +193,12 @@ WindowTree* WindowServer::GetTreeWithClientName( |
return nullptr; |
} |
+WindowTree* WindowServer::GetTreeForExternalWindowMode() { |
+ DCHECK_LE(1u, tree_map_.size()); |
+ DCHECK(IsInExternalWindowMode()); |
+ return tree_map_.begin()->second.get(); |
+} |
+ |
ServerWindow* WindowServer::GetWindow(const WindowId& id) { |
// kInvalidClientId is used for Display and WindowManager nodes. |
if (id.client_id == kInvalidClientId) { |
@@ -579,7 +585,7 @@ void WindowServer::FinishOperation() { |
void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { |
WindowManagerDisplayRoot* display_root = |
display_manager_->GetWindowManagerDisplayRoot(window); |
- if (display_root) { |
+ if (display_root && display_root->window_manager_state()) { |
EventDispatcher* event_dispatcher = |
display_root->window_manager_state()->event_dispatcher(); |
event_dispatcher->UpdateCursorProviderByLastKnownLocation(); |
@@ -591,7 +597,7 @@ void WindowServer::UpdateNativeCursorFromMouseLocation(ServerWindow* window) { |
void WindowServer::UpdateNativeCursorIfOver(ServerWindow* window) { |
WindowManagerDisplayRoot* display_root = |
display_manager_->GetWindowManagerDisplayRoot(window); |
- if (!display_root) |
+ if (!display_root || !display_root->window_manager_state()) |
return; |
EventDispatcher* event_dispatcher = |
@@ -665,7 +671,7 @@ void WindowServer::OnWindowHierarchyChanged(ServerWindow* window, |
WindowManagerDisplayRoot* display_root = |
display_manager_->GetWindowManagerDisplayRoot(window); |
- if (display_root) |
+ if (display_root && display_root->window_manager_state()) |
display_root->window_manager_state() |
->ReleaseCaptureBlockedByAnyModalWindow(); |
@@ -744,7 +750,7 @@ void WindowServer::OnWindowVisibilityChanged(ServerWindow* window) { |
WindowManagerDisplayRoot* display_root = |
display_manager_->GetWindowManagerDisplayRoot(window); |
- if (display_root) |
+ if (display_root && display_root->window_manager_state()) |
display_root->window_manager_state()->ReleaseCaptureBlockedByModalWindow( |
window); |
} |