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

Unified Diff: ash/mus/window_manager.cc

Issue 2784173002: Changes how window is updated when display changes in mash (Closed)
Patch Set: feedback Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/test/ash_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager.cc
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc
index a2cfe7bc506b5b793da965bf13fa1a4eed222bc6..7daf1484620f7e185a7216c841d714914d680058 100644
--- a/ash/mus/window_manager.cc
+++ b/ash/mus/window_manager.cc
@@ -485,7 +485,24 @@ void WindowManager::OnWmDisplayRemoved(
}
void WindowManager::OnWmDisplayModified(const display::Display& display) {
- screen_->display_list().UpdateDisplay(display);
+ // Ash relies on the Display being updated, then the WindowTreeHost's window,
+ // and finally DisplayObservers.
+ display::DisplayList& display_list = screen_->display_list();
+ std::unique_ptr<display::DisplayListObserverLock> display_lock =
+ display_list.SuspendObserverUpdates();
+ const bool is_primary = display_list.FindDisplayById(display.id()) ==
+ display_list.GetPrimaryDisplayIterator();
+ uint32_t display_changed_values = display_list.UpdateDisplay(
+ display, is_primary ? display::DisplayList::Type::PRIMARY
+ : display::DisplayList::Type::NOT_PRIMARY);
+ RootWindowController* root_window_controller =
+ WmShellMus::Get()->GetRootWindowControllerWithDisplayId(display.id());
+ DCHECK(root_window_controller);
+ root_window_controller->GetRootWindow()->GetHost()->SetBoundsInPixels(
+ display.bounds());
+ display_lock.reset();
+ for (display::DisplayObserver& observer : *(display_list.observers()))
+ observer.OnDisplayMetricsChanged(display, display_changed_values);
}
void WindowManager::OnWmPerformMoveLoop(
« no previous file with comments | « no previous file | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698