Index: services/ui/ws/window_tree.cc |
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc |
index f642e1f1c3291f98d25ebcc946bb1336a56e9068..68c32bbc1018084311a98d95f864d74fcc7da4f9 100644 |
--- a/services/ui/ws/window_tree.cc |
+++ b/services/ui/ws/window_tree.cc |
@@ -100,9 +100,14 @@ void WindowTree::Init(std::unique_ptr<WindowTreeBinding> binding, |
if (roots_.empty()) |
return; |
+ DoOnEmbed(std::move(tree), nullptr /*ServerWindow*/); |
fwang
2017/02/28 08:23:53
ditto about /* */ comment
|
+} |
+ |
+void WindowTree::DoOnEmbed(mojom::WindowTreePtr tree, ServerWindow* r) { |
fwang
2017/02/28 08:23:53
what about root_window to make it more explicit th
tonikitoo
2017/03/01 05:05:43
Done.
|
std::vector<const ServerWindow*> to_send; |
- CHECK_EQ(1u, roots_.size()); |
- const ServerWindow* root = *roots_.begin(); |
+ CHECK_NE(0u, roots_.size()); |
fwang
2017/02/28 08:23:53
These are unsigned integers, but maybe CHECK_LE(1u
tonikitoo
2017/03/01 05:05:43
Done.
|
+ |
+ const ServerWindow* root = r ? r : *roots_.begin(); |
GetUnknownWindowsFrom(root, &to_send); |
Display* display = GetDisplay(root); |
@@ -189,7 +194,7 @@ void WindowTree::PrepareForWindowServerShutdown() { |
window_manager_internal_ = binding_->GetWindowManager(); |
} |
-void WindowTree::AddRootForWindowManager(const ServerWindow* root) { |
+void WindowTree::AddRoot(const ServerWindow* root) { |
DCHECK(window_manager_internal_); |
const ClientWindowId client_window_id(WindowIdToTransportId(root->id())); |
DCHECK_EQ(0u, client_id_to_window_id_map_.count(client_window_id)); |
@@ -199,8 +204,11 @@ void WindowTree::AddRootForWindowManager(const ServerWindow* root) { |
Display* display = GetDisplay(root); |
DCHECK(display); |
+} |
- window_manager_internal_->WmNewDisplayAdded(display->ToDisplay(), |
+void WindowTree::AddRootForWindowManager(const ServerWindow* root) { |
+ AddRoot(root); |
+ window_manager_internal_->WmNewDisplayAdded(GetDisplay(root)->ToDisplay(), |
WindowToWindowData(root), |
root->parent()->IsDrawn()); |
fwang
2017/02/28 08:23:53
This is the part that ensures MusDemoInternal is a
|
} |