Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 716135 UI scaling is broken on high DPI screens with use_gtk3 build
Starred by 23 users Reported by chris.co...@canonical.com, Apr 27 Back to list
Status: Fixed
Owner:
Closed: May 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Regression



Sign in to add a comment
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.25 Safari/537.36

Steps to reproduce the problem:
1. Open Chrome/Dev on high DPI screen

What is the expected behavior?
The UI is scaled correctly

What went wrong?
The UI is unscaled.

Did this work before? Yes Before the switch to GTK3

Chrome version: 59.0.3071.25  Channel: dev
OS Version: 
Flash Version: 

Chrome determines the device scale by querying the "gtk-xft-dpi" property from GtkSettings. With GTK2, this always used to return the value of the "Xft/DPI" xsetting property, which is correctly set to 196608 (192 * 1024) on my system. However, in GTK3, it returns the value of the "Gdk/UnscaledDPI" xsetting property if this is set, and this is set to 98304 (96 * 1024) on my system.

See https://git.gnome.org/browse/gtk+/commit/?id=4b9c08f48d6f5be43b0795d3eee462d60b5f9e1f
 
Labels: -Pri-2 ReleaseBlock-Beta Pri-1
Owner: thomasanderson@chromium.org
Status: Assigned
I did submit a patch to review for this (https://codereview.chromium.org/2852593002/).
Thanks for the CL!  I'll take care of the merge to M59 once it lands.
Cc: thomasanderson@chromium.org a...@chromium.org e...@chromium.org osh...@chromium.org
 Issue 707349  has been merged into this issue.
Project Member Comment 5 by sheriffbot@chromium.org, May 1
This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone.

All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-59
Can you please request merge in to M59 branch if this is working correctly on ToT build ?
Project Member Comment 9 by bugdroid1@chromium.org, May 8
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3449c607560559da80f7ecc9c3e5b24440b9010c

commit 3449c607560559da80f7ecc9c3e5b24440b9010c
Author: thomasanderson <thomasanderson@google.com>
Date: Mon May 08 21:54:55 2017

Fix DPI scaling on Linux with GTK3

The device scale was determined by querying the value of the
"gtk-xft-dpi" property from GtkSettings. In GTK2, this always returned
the value of the "Xft/DPI" XSettings property. However, in GTK3, this
returns the value of "Gdk/UnscaledDPI" if it is set, resulting in the
wrong device scale being calculated on high DPI screens.

Instead, we now query the "gdk-window-scaling-factor" setting from
GdkScreen, which is derived from the value of the
"Gdk/WindowScalingFactor" XSettings property. If this property is not
set then we fall back to the previous code path, as environments that
don't provide Gdk/WindowScalingFactor also won't provide
Gdk/UnscaledDPI.

BUG= 716135 
TBR=erg@chromium.org

patch from issue 2852593002 at patchset 20001 (http://crrev.com/2852593002#ps20001)

Review-Url: https://codereview.chromium.org/2869763004
Cr-Commit-Position: refs/heads/master@{#470142}

[modify] https://crrev.com/3449c607560559da80f7ecc9c3e5b24440b9010c/chrome/browser/ui/libgtkui/gtk_ui.cc

Labels: Merge-Request-59
Project Member Comment 11 by bugdroid1@chromium.org, May 9
Labels: merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2c2751e4ab72020be05c7089047cdc4be6cd3923

commit 2c2751e4ab72020be05c7089047cdc4be6cd3923
Author: thomasanderson <thomasanderson@chromium.org>
Date: Tue May 09 17:53:54 2017

[Merge to M59] Fix DPI scaling on Linux with GTK3

> The device scale was determined by querying the value of the
> "gtk-xft-dpi" property from GtkSettings. In GTK2, this always returned
> the value of the "Xft/DPI" XSettings property. However, in GTK3, this
> returns the value of "Gdk/UnscaledDPI" if it is set, resulting in the
> wrong device scale being calculated on high DPI screens.
>
> Instead, we now query the "gdk-window-scaling-factor" setting from
> GdkScreen, which is derived from the value of the
> "Gdk/WindowScalingFactor" XSettings property. If this property is not
> set then we fall back to the previous code path, as environments that
> don't provide Gdk/WindowScalingFactor also won't provide
> Gdk/UnscaledDPI.
>
> BUG= 716135 
> TBR=erg@chromium.org
>
> patch from issue 2852593002 at patchset 20001 (http://crrev.com/2852593002#ps20001)
>
> Review-Url: https://codereview.chromium.org/2869763004
> Cr-Commit-Position: refs/heads/master@{#470142}

BUG= 716135 
TBR=erg@chromium.org
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2865253004
Cr-Commit-Position: refs/branch-heads/3071@{#481}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/2c2751e4ab72020be05c7089047cdc4be6cd3923/chrome/browser/ui/libgtkui/gtk_ui.cc

Status: Fixed
Project Member Comment 13 by sheriffbot@chromium.org, May 10
Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: krajshree@chromium.org
 Issue 717789  has been merged into this issue.
Labels: TE-Verified-M60 TE-Verified-60.0.3095.5
Verified this issue on Ubuntu 14.04 X1 Carbon HiDpi using chrome latest dev M60-60.0.3095.5 by following steps mentioned in the original comment. Observed the UI scaling is displayed as expected on high DPI screens with use_gtk3 build. Hence adding TE-Verified label.
Screenshot from 2017-05-11 15_44_50.png
212 KB View Download
Please merge your change to M59 branch 3071 by 4:00 PM PT, Monday (05/15) so we can take it in for next week beta release. Thank you.
Labels: -Merge-Approved-59
It's already merged. Not sure why it didn't remove the merge-approved tag. removing.

https://chromium.googlesource.com/chromium/src/+/2c2751e4ab72020be05c7089047cdc4be6cd3923
It's now far too large. Previously, I could have GNOME set to:

- window scaling: 2x
- font scaling: 75%

and the Chrome UI would respond accordingly.

Now it seems to be ignoring the font scaling, and so all of the UI is too large. Let me know if a new Issue is more appropriate.
In my last comment, Comment 18, I was on this build: Version 60.0.3095.5 (Official Build) dev (64-bit).
Cc: ranjitkan@chromium.org
Labels: Needs-Feedback
Verified the issue on Ubuntu 14.04 with build 59.0.3071.61 as mentioned in comment# 15. Scaling is displayed fine when used on high DPI screens with use_gtk3 build. 

But as per comment 18, @thomasanderson: Can you please provide an update as per comment#18.


I believe c#18 is a separate non-regression issue.  Chrome has always used the GTK font scaling value for both font and window scaling.

AFAIK there's no way to adjust the two separately.  oshima@ is this correct?
 Issue 721831  has been merged into this issue.
Yes, that is correct.
I'm not sure I understand. Chrome canary is now much larger on my system than Chrome stable. I don't see how it could not be a regression.

Anyway, I'll install Chrome stable and take a screenshot and file a new issue tonight. (And thanks for fixing this one! 2x is definitely better than 1x on the Pixel, for example.)
Comment 25 Deleted
I concur with the above. Here's a screenshot which shows beta (on the left) now being larger than stable.
Screenshot from 2017-05-22 15-47-10.png
714 KB View Download
I don't know why my comment (#25) was removed. It was cross-linking to the new bug that was opened for the UI being too large now: https://bugs.chromium.org/p/chromium/issues/detail?id=723931. I'm linking it here again, because this bug is still marked "Fixed".

If this comment is to be removed again, can I please understand why? Is it not allowed to crosslink bugs?
Sign in to add a comment