Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GTK ignores monitor DPI [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
motig
n00b
n00b


Joined: 11 Oct 2016
Posts: 23

PostPosted: Sun Jul 26, 2020 10:03 am    Post subject: GTK ignores monitor DPI [SOLVED] Reply with quote

Hello,
I have updated my system after a couple of months and after restarting I have noticed that GTK+ applications seem to now ignore the monitor DPI and are probably using the default of 96. Their interface/fonts are smaller than they used to be. Unfortunately due to the number of packages updated I have no way of finding out what caused this. GTK itself has been upgraded from version 3.24.13 to 3.24.20. I am mostly using KDE and all KDE and Qt applications look perfectly fine. It is only the few GTK ones that are having this problem.

xdpyinfo:
Code:

screen #0:
  dimensions:    1920x1080 pixels (309x174 millimeters)
  resolution:    158x158 dots per inch


xrandr:
Code:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
eDP connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm


I am not sure where else to check for the current DPI settings and what might be confusing the GTK apps... I do not have Gnome installed. The weirdest thing is that in my GTK mail client (Sylpheed) the message font size is as big as it should be while everything else is smaller.


Last edited by motig on Sun Jul 26, 2020 12:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6719

PostPosted: Sun Jul 26, 2020 10:44 am    Post subject: Reply with quote

Sylpheed uses GTK2, not 3, which is probably why it's well-behaved.

Run `gtk-query-settings dpi`. It should show what gtk3 thinks the current dpi (×1024) is. Setting Xft.dpi explicitly in ~/.Xresources should fix it but you might have to log out and in.

You might find https://wiki.archlinux.org/index.php/HiDPI#GUI_toolkits useful also.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1885

PostPosted: Sun Jul 26, 2020 10:49 am    Post subject: Reply with quote

Ihteresting, here's
Code:
gtk-query-settings dpi
                        gtk-xft-dpi: 98304
using a low budget 1920*1080 HDMI.
Is it fine or should I worry?
Thks 4 ur attentionn interest & support.
Back to top
View user's profile Send private message
motig
n00b
n00b


Joined: 11 Oct 2016
Posts: 23

PostPosted: Sun Jul 26, 2020 11:15 am    Post subject: Reply with quote

Interesting. It really seems to think the DPI is 96.

Code:

$ gtk-query-settings dpi
                        gtk-xft-dpi: 98304


I will try setting it in .Xresources and we'll see
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1885

PostPosted: Sun Jul 26, 2020 11:29 am    Post subject: Reply with quote

Following Method, here's
Code:
xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    1920x1080 pixels (508x285 millimeters)
  resolution:    96x96 dots per inch
luc@amd64 ~ $ xrandr | grep -w connected
HDMI1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 380mm x 300mm
which dotless computation brings:
Code:
380000 / 254
1496
19200000 / 1496
12834= ~128.34
and
Code:
300000 / 254
1181
10800000 / 1181
9144 = ~91.44
So two # values. Which to take into account... the bigger?
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
motig
n00b
n00b


Joined: 11 Oct 2016
Posts: 23

PostPosted: Sun Jul 26, 2020 12:01 pm    Post subject: Reply with quote

Thank you for the tip, setting Xft.dpi seems to have helped.

Code:

$ gtk-query-settings dpi
                        gtk-xft-dpi: 161792


Also it seems some new fonts have been installed which the applications prefer so they do not look exactly the same as before but the interface size is fine now.

Also you can reload the .Xresources by using this command:

Code:

xrdb ~/.Xresources


No need to log out :)
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1885

PostPosted: Sun Jul 26, 2020 1:54 pm    Post subject: Reply with quote

CaptainBlood wrote:
So two # values. Which to take into account... the bigger?
According to ArchWiki
Code:
For Xft.dpi, using integer multiples of 96 usually works best, e.g. 192 for 200% scaling.
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum