| Index: ui/aura/mus/window_port_mus.cc
|
| diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
|
| index da5774c1935d7a7a56b1a23f5c0734bb665636cc..d27fad3acd996243f92509112957809462e3bdff 100644
|
| --- a/ui/aura/mus/window_port_mus.cc
|
| +++ b/ui/aura/mus/window_port_mus.cc
|
| @@ -14,8 +14,21 @@
|
| #include "ui/aura/window_delegate.h"
|
| #include "ui/aura/window_observer.h"
|
| #include "ui/aura/window_property.h"
|
| +#include "ui/display/screen.h"
|
| +#include "ui/gfx/geometry/dip_util.h"
|
|
|
| namespace aura {
|
| +namespace {
|
| +
|
| +// Helper function to get the device_scale_factor() of the display::Display
|
| +// nearest to |window|.
|
| +float ScaleFactorForDisplay(Window* window) {
|
| + return display::Screen::GetScreen()
|
| + ->GetDisplayNearestWindow(window)
|
| + .device_scale_factor();
|
| +}
|
| +
|
| +} // namespace
|
|
|
| WindowPortMus::WindowMusChangeDataImpl::WindowMusChangeDataImpl() = default;
|
|
|
| @@ -208,7 +221,8 @@ void WindowPortMus::SetBoundsFromServer(const gfx::Rect& bounds) {
|
| ServerChangeData data;
|
| data.bounds = bounds;
|
| ScopedServerChange change(this, ServerChangeType::BOUNDS, data);
|
| - window_->SetBounds(bounds);
|
| + window_->SetBounds(
|
| + gfx::ConvertRectToDIP(ScaleFactorForDisplay(window_), bounds));
|
| }
|
|
|
| void WindowPortMus::SetVisibleFromServer(bool visible) {
|
| @@ -408,7 +422,8 @@ void WindowPortMus::OnVisibilityChanged(bool visible) {
|
| void WindowPortMus::OnDidChangeBounds(const gfx::Rect& old_bounds,
|
| const gfx::Rect& new_bounds) {
|
| ServerChangeData change_data;
|
| - change_data.bounds = new_bounds;
|
| + change_data.bounds =
|
| + gfx::ConvertRectToPixel(ScaleFactorForDisplay(window_), new_bounds);
|
| if (!RemoveChangeByTypeAndData(ServerChangeType::BOUNDS, change_data))
|
| window_tree_client_->OnWindowMusBoundsChanged(this, old_bounds, new_bounds);
|
| }
|
|
|