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

Issue 2900133002: Gtk: Consider font dpi when calculating device scale factor (Closed)

Created:
3 years, 7 months ago by Tom Anderson
Modified:
3 years, 7 months ago
Reviewers:
Elliot Glaysher
CC:
chromium-reviews
Target Ref:
refs/branch-heads/3071
Project:
chromium
Visibility:
Public.

Description

Gtk: Consider font dpi when calculating device scale factor > Gtk2 did not have a global window scaling setting (so the only way to > scale up widgets was with a custom theme). However, it did allow font > scaling with gdk-xft-dpi (backed by XSetting Xft/DPI). > > Gtk3 adds (non-fractional) global window scaling with > gdk-window-scaling-factor (XSetting Gdk/WindowScalingFactor). To > ensure that fonts were not scaled up twice (once from > gdk-window-scaling-factor and once from gdk-xft-dpi), a new setting > was added in [1] that overrides gdk-xft-dpi: gdk-unscaled-dpi > (XSetting Gdk/UnscaledDPI). gdk-xft-dpi was kept around for > compatibility with apps like Chromium that still need it. > > When modifying these settings, an invariant should be maintained: > gdk-xft-dpi = gtk-window-scaling-factor * gdk-unscaled-dpi. Chromium > should have been able to keep using gdk-xft-dpi, but this invariant is > violated when changing the settings using gnome-tweak-tool, where I > have gdk-window-scaling-factor = 2, gdk-unscaled-dpi = 98304, and > gdk-xft-dpi = 98304 (gdk-xft-dpi should be 196608). > > [2] changed Gtk builds to use the window scaling factor, which is > incorrect because it did not consider font scaling, making fractional > scaling impossible. > > This CL takes gdk-unscaled-dpi into the calculation as well, and > continues to fallback on using gdk-xft-dpi if the other variables are > unavailable, which can happen on Gtk2. > > [1] https://git.gnome.org/browse/gtk+/commit/?id=4b9c08f48d6f5be43b0795d3eee462d60b5f9e1f > [2] https://codereview.chromium.org/2869763004 > > BUG=723931 > R=erg@chromium.org,chris.coulson@canonical.com > CC=oshima@chromium.org > > Review-Url: https://codereview.chromium.org/2899943002 > Cr-Commit-Position: refs/heads/master@{#473966} BUG=723931 TBR=erg@chromium.org NOTRY=true NOPRESUBMIT=true Review-Url: https://codereview.chromium.org/2900133002 Cr-Commit-Position: refs/branch-heads/3071@{#674} Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641} Committed: https://chromium.googlesource.com/chromium/src/+/5afa8d4f6e8ed276821ecaa4ec62b501e90d8d37

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -9 lines) Patch
M chrome/browser/ui/libgtkui/gtk_ui.cc View 2 chunks +23 lines, -9 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
Tom Anderson
Landing this now (without merge approval) because I want this to make the last beta ...
3 years, 7 months ago (2017-05-23 18:12:03 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2900133002/1
3 years, 7 months ago (2017-05-23 18:12:49 UTC) #3
commit-bot: I haz the power
3 years, 7 months ago (2017-05-23 18:15:50 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/5afa8d4f6e8ed276821ecaa4ec62...

Powered by Google App Engine
This is Rietveld 408576698