Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: services/ui/ws/display.cc

Issue 2330093003: Fix adding displays in mustash. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | services/ui/ws/display_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/display.h" 5 #include "services/ui/ws/display.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 WindowManagerDisplayRoot* display_root = display_root_ptr.get(); 243 WindowManagerDisplayRoot* display_root = display_root_ptr.get();
244 // For this case we never create additional displays roots, so any 244 // For this case we never create additional displays roots, so any
245 // id works. 245 // id works.
246 window_manager_display_root_map_[shell::mojom::kRootUserID] = 246 window_manager_display_root_map_[shell::mojom::kRootUserID] =
247 std::move(display_root_ptr); 247 std::move(display_root_ptr);
248 WindowTree* window_tree = binding_->CreateWindowTree(display_root->root()); 248 WindowTree* window_tree = binding_->CreateWindowTree(display_root->root());
249 display_root->window_manager_state_ = window_tree->window_manager_state(); 249 display_root->window_manager_state_ = window_tree->window_manager_state();
250 } else { 250 } else {
251 CreateWindowManagerDisplayRootsFromFactories(); 251 CreateWindowManagerDisplayRootsFromFactories();
252 } 252 }
253 display_manager()->OnDisplayUpdate(this);
253 } 254 }
254 255
255 void Display::CreateWindowManagerDisplayRootsFromFactories() { 256 void Display::CreateWindowManagerDisplayRootsFromFactories() {
256 std::vector<WindowManagerWindowTreeFactory*> factories = 257 std::vector<WindowManagerWindowTreeFactory*> factories =
257 window_server_->window_manager_window_tree_factory_set()->GetFactories(); 258 window_server_->window_manager_window_tree_factory_set()->GetFactories();
258 for (WindowManagerWindowTreeFactory* factory : factories) { 259 for (WindowManagerWindowTreeFactory* factory : factories) {
259 if (factory->window_tree()) 260 if (factory->window_tree())
260 CreateWindowManagerDisplayRootFromFactory(factory); 261 CreateWindowManagerDisplayRootFromFactory(factory);
261 } 262 }
262 } 263 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 root_->SetBounds(new_bounds); 316 root_->SetBounds(new_bounds);
316 root_->SetVisible(true); 317 root_->SetVisible(true);
317 focus_controller_.reset(new FocusController(this, root_.get())); 318 focus_controller_.reset(new FocusController(this, root_.get()));
318 focus_controller_->AddObserver(this); 319 focus_controller_->AddObserver(this);
319 InitWindowManagerDisplayRootsIfNecessary(); 320 InitWindowManagerDisplayRootsIfNecessary();
320 } else { 321 } else {
321 root_->SetBounds(new_bounds); 322 root_->SetBounds(new_bounds);
322 for (auto& pair : window_manager_display_root_map_) 323 for (auto& pair : window_manager_display_root_map_)
323 pair.second->root()->SetBounds(new_bounds); 324 pair.second->root()->SetBounds(new_bounds);
324 } 325 }
325 display_manager()->OnDisplayUpdate(this); 326 if (init_called_)
327 display_manager()->OnDisplayUpdate(this);
326 } 328 }
327 329
328 void Display::OnCompositorFrameDrawn() { 330 void Display::OnCompositorFrameDrawn() {
329 std::set<ServerWindow*> windows; 331 std::set<ServerWindow*> windows;
330 windows.swap(windows_needing_frame_destruction_); 332 windows.swap(windows_needing_frame_destruction_);
331 for (ServerWindow* window : windows) { 333 for (ServerWindow* window : windows) {
332 window->RemoveObserver(this); 334 window->RemoveObserver(this);
333 window->DestroySurfacesScheduledForDestruction(); 335 window->DestroySurfacesScheduledForDestruction();
334 } 336 }
335 } 337 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 422 }
421 423
422 void Display::OnWindowManagerWindowTreeFactoryReady( 424 void Display::OnWindowManagerWindowTreeFactoryReady(
423 WindowManagerWindowTreeFactory* factory) { 425 WindowManagerWindowTreeFactory* factory) {
424 if (!binding_) 426 if (!binding_)
425 CreateWindowManagerDisplayRootFromFactory(factory); 427 CreateWindowManagerDisplayRootFromFactory(factory);
426 } 428 }
427 429
428 } // namespace ws 430 } // namespace ws
429 } // namespace ui 431 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | services/ui/ws/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698