Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_screen_x11.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc |
| index ed8a0f4844cd7f002c6d1c492eff05575ebedf81..1f6716890fa41535826e1b86f20aa3fab517059b 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc |
| @@ -20,6 +20,8 @@ |
| #include "ui/display/util/x11/edid_parser_x11.h" |
| #include "ui/events/platform/platform_event_source.h" |
| #include "ui/gfx/display.h" |
| +#include "ui/gfx/geometry/point_conversions.h" |
| +#include "ui/gfx/geometry/size_conversions.h" |
| #include "ui/gfx/native_widget_types.h" |
| #include "ui/gfx/screen.h" |
| #include "ui/gfx/x/x11_types.h" |
| @@ -315,9 +317,15 @@ std::vector<gfx::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() { |
| } |
| if (has_work_area) { |
| - gfx::Rect intersection = crtc_bounds; |
| - intersection.Intersect(work_area); |
| - display.set_work_area(intersection); |
| + gfx::Rect intersection_in_pixels = crtc_bounds; |
|
sadrul
2015/03/28 22:26:02
Our gfx::Display API is ... confusing. Mind leavin
stapelberg
2015/03/29 14:37:19
Done.
|
| + intersection_in_pixels.Intersect(work_area); |
| + display.set_work_area(gfx::Rect( |
| + gfx::ToFlooredPoint( |
| + gfx::ScalePoint(intersection_in_pixels.origin(), |
| + 1.0f / display.device_scale_factor())), |
| + gfx::ToFlooredSize( |
| + gfx::ScaleSize(intersection_in_pixels.size(), |
| + 1.0f / display.device_scale_factor())))); |
| } |
| switch (crtc->rotation) { |