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

Unified Diff: services/ui/ws/display.cc

Issue 2230963003: Fix window/display bounds with multiple windows in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes. Created 4 years, 4 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 | « services/ui/service.cc ('k') | services/ui/ws/platform_display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display.cc
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc
index c58c98168f04f9f444416c0a4cdacc61614fa987..b247f976c9c1e0043e99575f5da71d8e28f2495c 100644
--- a/services/ui/ws/display.cc
+++ b/services/ui/ws/display.cc
@@ -88,10 +88,9 @@ mojom::WsDisplayPtr Display::ToWsDisplay() const {
mojom::WsDisplayPtr display_ptr = mojom::WsDisplay::New();
display_ptr->display = ToDisplay();
+ display_ptr->is_primary = platform_display_->IsPrimaryDisplay();
// TODO(sky): make this real.
- display_ptr->is_primary = true;
- // TODO(sky): make this real.
display_ptr->frame_decoration_values = mojom::FrameDecorationValues::New();
return display_ptr;
}
@@ -99,9 +98,7 @@ mojom::WsDisplayPtr Display::ToWsDisplay() const {
display::Display Display::ToDisplay() const {
display::Display display(GetId());
- // TODO(sky): Display should know its origin.
- display.set_bounds(gfx::Rect(0, 0, root_->bounds().size().width(),
- root_->bounds().size().height()));
+ display.set_bounds(platform_display_->GetBounds());
// TODO(sky): window manager needs an API to set the work area.
display.set_work_area(display.bounds());
display.set_device_scale_factor(platform_display_->GetDeviceScaleFactor());
@@ -134,7 +131,7 @@ display::Display::Rotation Display::GetRotation() const {
}
gfx::Size Display::GetSize() const {
- return root_->bounds().size();
+ return platform_display_->GetBounds().size();
}
ServerWindow* Display::GetRootWithId(const WindowId& id) {
@@ -321,9 +318,8 @@ void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics,
InitWindowManagerDisplayRootsIfNecessary();
} else {
root_->SetBounds(new_metrics.bounds);
- const gfx::Rect wm_bounds(root_->bounds().size());
for (auto& pair : window_manager_display_root_map_)
- pair.second->root()->SetBounds(wm_bounds);
+ pair.second->root()->SetBounds(new_metrics.bounds);
}
display_manager()->OnDisplayUpdate(this);
}
« no previous file with comments | « services/ui/service.cc ('k') | services/ui/ws/platform_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698