Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPI scaling appears to be applied twice #24

Closed
auscompgeek opened this issue May 3, 2017 · 6 comments
Closed

DPI scaling appears to be applied twice #24

auscompgeek opened this issue May 3, 2017 · 6 comments

Comments

@auscompgeek
Copy link

auscompgeek commented May 3, 2017

I have my text scaling factor set to 1.25 in GNOME. With QGnomePlatform, text appears too large. This doesn't happen with qt5ct or QGtkStyle.

Setting the DPI to 96 in KDE System Settings makes the text size consistent with GNOME, but then obviously the correct DPI won't be used in KDE…

@MartinBriza
Copy link
Collaborator

MartinBriza commented May 4, 2017 via email

@Venemo
Copy link

Venemo commented Jul 26, 2018

@MartinBriza For interested parties who might want to help contribute to this issue, could you give us a clue about what might be the problem here and how to fix it?

@leidav
Copy link
Contributor

leidav commented Oct 17, 2018

The font scaling seems to be applied twice.
When i change
gdouble scaling = g_settings_get_double(m_settings, "text-scaling-factor");
to
gdouble scaling = 1.0;
the correct font scaling (1.25 on my system) is applied.

@auscompgeek
Copy link
Author

auscompgeek commented Oct 29, 2018

Nice find. I'm guessing something else is already picking up the correct DPI settings, so then scaling the font sizes ourselves is the wrong thing to do.

@h4tr3d
Copy link
Contributor

h4tr3d commented Nov 14, 2018

Qt 5.6 just introduce new HiDPI handling. It uses system-wide information for proper scaling: xrandr info, Xft.dpi (it uses by libxcursor that uses by Qt5 and currently it work wrong. I have idea how to fix it but have no time for it temporally). When you configure text-scale-factor it also affect xrandr settings (xdpyinfo | grep -B2 resolution). Qt just load this information and apply valid scaling. When additional up-scaling is applied fonts just looks huge.

My current solution: enable scaling for Qt < 5.6 (Qt4 inclusive) and force 1.0 for Qt >= 5.6:
h4tr3d@6b6af5c

@grulja
Copy link
Collaborator

grulja commented Nov 18, 2018

Fixed in master.

@grulja grulja closed this as completed Nov 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants