Bug 389523 - GDK_DPI_SCALE seems to have changed with the latest updates to 0.571429. Firefox, Chromium and Thunderbird now have tiny fonts on a hidpi screen despite existing settings to scale the display.
Summary: GDK_DPI_SCALE seems to have changed with the latest updates to 0.571429. Fire...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.11.95
Platform: openSUSE Linux
: NOR major
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-27 19:28 UTC by Aayush Agarwal
Modified: 2018-08-06 17:12 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The tabs and menu bars have tiny fonts, unlike the window decoration and browser. (190.96 KB, image/png)
2018-01-27 19:28 UTC, Aayush Agarwal
Details
env output (5.39 KB, text/plain)
2018-01-30 14:20 UTC, Dennis Irrgang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aayush Agarwal 2018-01-27 19:28:38 UTC
Created attachment 110156 [details]
The tabs and menu bars have tiny fonts, unlike the window decoration and browser.

I have a laptop with a hidpi screen (14" 1440p). I configured my dpi to 168 and scaled the display to 1.75.

I had to set layout.css.devPixelsPerPx;1.75 on firefox, while thunderbird was fine out of the box with my dpi and monitor scaling settings.

This configuration worked just fine until tumbleweed updated to more recent snapshots.

Firefox interface fonts became very small, while Thunderbird became tiny. Modifying the layout.css attribute in thunderbird restored order to the mail size, but the interface is still tiny.

Chromium too became tiny, with no scaling to respect hidpi screens.

I tried appending export GDK_DPI_SCALE=1.75 to my .profile. I figured maybe there was a change in the configuration which caused this. However that did not work.

I dug around and found that while GDK_SCALE was 1.75, GDK_DPI_SCALE was 0.571429. My export statement was ignored. Multiply the values of the two environmental variables and you get 1.00000075, or almost exactly 1x scaling.
Comment 1 Dennis Irrgang 2018-01-30 14:19:31 UTC
I just upgraded my system and I've run into the same issue.
Comment 2 Dennis Irrgang 2018-01-30 14:20:26 UTC
Created attachment 110225 [details]
env output

Attached output of my env variables.
Comment 3 Fabian Vogt 2018-01-30 14:25:34 UTC
Whatever startkde does to those environment variables is completely wrong:

    export GDK_SCALE=$kdeglobals_kscreen_scalefactor
    export GDK_DPI_SCALE=`awk "BEGIN {print 1/$kdeglobals_kscreen_scalefactor}"`

According to https://developer.gnome.org/gtk3/stable/gtk-x11.html this will *always* result in a effective scale of 1.

I suggest:

- Round up GDK_SCALE to the next integer
- Set GDK_DPI_SCALE to account for the difference in rounding
Comment 4 Dennis Irrgang 2018-01-30 15:02:10 UTC
GDK_SCALE=2 GDK_DPI_SCALE=0.75 thunderbird >> too large (2.0x scaling)
GDK_SCALE=1 GDK_DPI_SCALE=1.5 thunderbird >> too large (2.0x scaling)
unset GDK_SCALE
unset GDK_DPI_SCALE
thunderbird >> correct (1.5x scaling)
GDK_SCALE=1 GDK_DPI_SCALE=1 thunderbird >> correct (1.5x scaling)
env | grep SCALE (notice the missing GDK scaling values)
QT_SCREEN_SCALE_FACTORS=DVI-D-1=1.5;DP-1=1.5;DP-2=1.5;HDMI-1=1.5;DP-3=1.5;
QT_AUTO_SCREEN_SCALE_FACTOR=0
Comment 5 Aayush Agarwal 2018-01-31 03:18:10 UTC
(In reply to Fabian Vogt from comment #3)
> Whatever startkde does to those environment variables is completely wrong:
> 
>     export GDK_SCALE=$kdeglobals_kscreen_scalefactor
>     export GDK_DPI_SCALE=`awk "BEGIN {print
> 1/$kdeglobals_kscreen_scalefactor}"`
> 
> According to https://developer.gnome.org/gtk3/stable/gtk-x11.html this will
> *always* result in a effective scale of 1.
> 
> I suggest:
> 
> - Round up GDK_SCALE to the next integer
> - Set GDK_DPI_SCALE to account for the difference in rounding

Rounding GDK_SCALE to the next integer (2x?) will make the UI too big. Why not calculate GDK_DPI_SCALE based on the dpi set for the font?
Comment 6 David Edmundson 2018-02-01 10:28:11 UTC
Git commit 8083d4587512ee4aec03b00f710938c0ebcc0aba by David Edmundson.
Committed on 01/02/2018 at 10:23.
Pushed by davidedmundson into branch 'Plasma/5.12'.

Revert "Set GTK scaling env vars"

This reverts commit aba3d48c07fce03d9e23717fc24de06aad5c75d7.

It causes issues for multiple GTK apps when fractional factors are used.
Given GDK already has it's own auto scaling, this seems to cause more problems
than it solves in its current form.

M  +0    -3    startkde/startkde.cmake

https://commits.kde.org/plasma-workspace/8083d4587512ee4aec03b00f710938c0ebcc0aba
Comment 7 Nate Graham 2018-08-06 17:12:31 UTC
Let's give this another go in Bug 397217.

One final note: the Force Fonts DPI setting is not intended to be used as a systemwide scale factor system. Using that in conjunction with the Scaling in the Display & Monitor KCM is asking for trouble.