Index: services/ui/ws/window_server.cc |
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc |
index c1fff169fc9dcddf0c9b6f3360b2167665bafbb2..f48149ee5dd483917c1e429a9702f8da3553e522 100644 |
--- a/services/ui/ws/window_server.cc |
+++ b/services/ui/ws/window_server.cc |
@@ -31,33 +31,6 @@ |
namespace ui { |
namespace ws { |
-namespace { |
- |
-// Returns true if |window| is considered the active window manager for |
-// |display|. |
-bool IsWindowConsideredWindowManagerRoot(const Display* display, |
- const ServerWindow* window) { |
- if (!display) |
- return false; |
- |
- const WindowManagerDisplayRoot* display_root = |
- display->GetActiveWindowManagerDisplayRoot(); |
- if (!display_root) |
- return false; |
- |
- if (window == display_root->root()) |
- return true; |
- |
- // If the window manager manually creates displays then there is an extra |
- // window, the window supplied via SetDisplayRoot(). |
- return !display_root->window_manager_state() |
- ->window_tree() |
- ->automatically_create_display_roots() && |
- window->parent() == display_root->root(); |
-} |
- |
-} // namespace |
- |
struct WindowServer::CurrentMoveLoopState { |
uint32_t change_id; |
ServerWindow* window; |
@@ -851,8 +824,8 @@ |
if (!window_paint_callback_.is_null()) |
window_paint_callback_.Run(window); |
- Display* display = display_manager_->GetDisplayContaining(window); |
- if (IsWindowConsideredWindowManagerRoot(display, window)) { |
+ auto* display = display_manager_->GetDisplayContaining(window); |
+ if (display && window == display->GetActiveRootWindow()) { |
// A new surface for a WindowManager root has been created. This is a |
// special case because ServerWindows created by the WindowServer are not |
// part of a WindowTree. Send the SurfaceId directly to FrameGenerator and |