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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_x11.cc

Issue 1036263003: hi-dpi: convert _NET_WORKAREA from pixels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698