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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2434923002: Handle modified displays in mustash. (Closed)
Patch Set: Fix PlatformScreenStub for tests. Created 4 years, 2 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 | « ash/mus/root_window_controller.h ('k') | ash/mus/window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index def83f68ac71d3476c037e94174445d704ddea0c..4279731f0df65714c0b6267737bf9c288226dab0 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -126,18 +126,25 @@ WmWindowMus* RootWindowController::GetWindowByShellWindowId(int id) {
}
void RootWindowController::SetWorkAreaInests(const gfx::Insets& insets) {
+ gfx::Rect old_work_area = display_.work_area();
display_.UpdateWorkAreaFromInsets(insets);
- display::DisplayList* display_list =
- window_manager_->screen()->display_list();
- auto iter = display_list->FindDisplayById(display_.id());
- DCHECK(iter != display_list->displays().end());
- const display::DisplayList::Type display_type =
- iter == display_list->GetPrimaryDisplayIterator()
- ? display::DisplayList::Type::PRIMARY
- : display::DisplayList::Type::NOT_PRIMARY;
- display_list->UpdateDisplay(display_, display_type);
- // TODO(kylechar): needs to push to DisplayController.
- NOTIMPLEMENTED();
+
+ if (old_work_area == display_.work_area())
+ return;
+
+ window_manager_->screen()->display_list()->UpdateDisplay(display_);
+
+ // Push new display insets to service:ui if we have a connection.
+ auto* display_controller = window_manager_->GetDisplayController();
+ if (display_controller)
+ display_controller->SetDisplayWorkArea(display_.id(),
+ display_.bounds().size(), insets);
+}
+
+void RootWindowController::SetDisplay(const display::Display& display) {
+ DCHECK_EQ(display.id(), display_.id());
+ display_ = display;
+ window_manager_->screen()->display_list()->UpdateDisplay(display_);
}
gfx::Rect RootWindowController::CalculateDefaultBounds(
« no previous file with comments | « ash/mus/root_window_controller.h ('k') | ash/mus/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698