Commit 71444095 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

ozone: Do not add display origin to bounds in pixels.

GetWindowBoundsInScreen adds display origin to
bounds in pixels, which is incorrect, because they contain
a location in screen, and adding additional offset results
in wrong positions for menus (when the browser is located
on a secondary display).

Bug: 927280
Change-Id: Ib16f46b095751cb3f29bfa6579d44eabdf104647
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497052Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#637604}
parent d9000497
...@@ -259,13 +259,7 @@ void DesktopWindowTreeHostPlatform::GetWindowPlacement( ...@@ -259,13 +259,7 @@ void DesktopWindowTreeHostPlatform::GetWindowPlacement(
} }
gfx::Rect DesktopWindowTreeHostPlatform::GetWindowBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostPlatform::GetWindowBoundsInScreen() const {
gfx::Rect bounds = return gfx::ConvertRectToDIP(device_scale_factor(), GetBoundsInPixels());
gfx::ConvertRectToDIP(device_scale_factor(), GetBoundsInPixels());
bounds += display::Screen::GetScreen()
->GetDisplayNearestWindow(const_cast<aura::Window*>(window()))
.bounds()
.OffsetFromOrigin();
return bounds;
} }
gfx::Rect DesktopWindowTreeHostPlatform::GetClientAreaBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostPlatform::GetClientAreaBoundsInScreen() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment