Index: services/ui/ws/display.cc |
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc |
index 19a73ca58a10ede66ad45cd1fed50f751841a2c5..f11f959aa50f8c5a9b92abd93162f39a2f22c028 100644 |
--- a/services/ui/ws/display.cc |
+++ b/services/ui/ws/display.cc |
@@ -99,11 +99,13 @@ mojom::WsDisplayPtr Display::ToWsDisplay() const { |
display::Display Display::ToDisplay() const { |
display::Display display(GetId()); |
- 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()); |
- display.set_rotation(platform_display_->GetRotation()); |
+ const display::ViewportMetrics& metrics = |
+ platform_display_->GetViewportMetrics(); |
+ |
+ display.set_bounds(metrics.bounds); |
+ display.set_work_area(metrics.work_area); |
+ display.set_device_scale_factor(metrics.device_scale_factor); |
+ display.set_rotation(metrics.rotation); |
display.set_touch_support( |
display::Display::TouchSupport::TOUCH_SUPPORT_UNKNOWN); |
@@ -116,10 +118,6 @@ void Display::SchedulePaint(const ServerWindow* window, |
platform_display_->SchedulePaint(window, bounds); |
} |
-display::Display::Rotation Display::GetRotation() const { |
- return platform_display_->GetRotation(); |
-} |
- |
gfx::Size Display::GetSize() const { |
return platform_display_->GetBounds().size(); |
} |
@@ -309,17 +307,15 @@ void Display::OnNativeCaptureLost() { |
display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId); |
} |
-void Display::OnViewportMetricsChanged(const ViewportMetrics& old_metrics, |
- const ViewportMetrics& new_metrics) { |
- if (!root_) |
+void Display::OnViewportMetricsChanged( |
+ const display::ViewportMetrics& new_metrics) { |
+ if (!root_ || root_->bounds().size() == new_metrics.bounds.size()) |
return; |
gfx::Rect new_bounds(new_metrics.bounds.size()); |
root_->SetBounds(new_bounds); |
for (auto& pair : window_manager_display_root_map_) |
pair.second->root()->SetBounds(new_bounds); |
- |
- display_manager()->OnDisplayUpdate(this); |
} |
bool Display::CanHaveActiveChildren(ServerWindow* window) const { |