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

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

Issue 1070433002: device scale factor detection: use gtk-xft-dpi consistently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 019688fb9463fb518681202d611a0fc90160a6b2..8673c20af50e65a6446bcce99132759cc5d0aa11 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -295,6 +295,13 @@ std::vector<gfx::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() {
}
float device_scale_factor = 1.0f;
+ {
+ // As per-display scale factor is not supported right now,
+ // the X11 root window's scale factor is always used.
+ // This is what users can change using e.g. xrandr -dpi 96
+ std::vector<gfx::Display> fallback_displays = GetFallbackDisplayList();
+ device_scale_factor = fallback_displays[0].device_scale_factor();
+ }
for (int i = 0; i < resources->noutput; ++i) {
RROutput output_id = resources->outputs[i];
gfx::XScopedPtr<XRROutputInfo,
@@ -321,14 +328,6 @@ std::vector<gfx::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() {
gfx::Display display(display_id, crtc_bounds);
if (!gfx::Display::HasForceDeviceScaleFactor()) {
- if (i == 0 && !ui::IsDisplaySizeBlackListed(
- gfx::Size(output_info->mm_width, output_info->mm_height))) {
- // As per display scale factor is not supported right now,
- // the primary display's scale factor is always used.
- device_scale_factor = GetDeviceScaleFactor(crtc->width,
- output_info->mm_width);
- DCHECK_LE(1.0f, device_scale_factor);
- }
display.SetScaleAndBounds(device_scale_factor, crtc_bounds);
}
« 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