[Bug 1202837] New: YAST and some QT5 apps (but not all) scaling problems in 4k UHD / HIDPI screens
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 Bug ID: 1202837 Summary: YAST and some QT5 apps (but not all) scaling problems in 4k UHD / HIDPI screens Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: openSUSE Tumbleweed Status: NEW Severity: Normal Priority: P5 - None Component: GNOME Assignee: gnome-bugs@suse.de Reporter: c.j@tuta.io QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Everything was fine in 1080p. THE CAUSE OF THE CHANGE: I have now connected a 28" 4k UHD screen, and I now have Big scaling problems with some (but not all) QT5 apps and Yast, etc... I have left scaling factor in Gnome settings screens at 100% because 200% is too big, but set fonts scaling in gnome tweaks to 1.5. (this is ok in Gnome). THE PROBLEM: Some QT5 apps fonts are now HUGE. Example: Yast and chessx have the same huge font size. But, for example, peazip (also qt5 but built with lazarus) is ok. QT6 apps are fine (don't need any scaling correction). HOW TO FIX: Starting the apps that cause the problem with, for example:
"QT_AUTO_SCREEN_SCALE_FACTOR=1 yast2" (0 is too small as it removes the scaling and 2 is the same as the default which is HUGE. 1 is fine).
(Using gnome X11 due to nvidia 470 drivers). Please advise. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c1 --- Comment #1 from C J <c.j@tuta.io> --- The latest mesa updates seem to have amazingly fixed wayland on nvidia, so I am now on wayland and I could enable proper 150% scaling. The scaling problem with qt5 apps and yast is less apparent, but: 1. the fonts are still a little to big. 2. The fonts are blurry. Everything is still fine with QT6 apps (fonts are sharp and the size is ok). Conclusion : 2 fixes are possible 1. Either you can fix the font scaling bug with qt5 apps. 2. Or a push is made to hurriedly port the apps from qt5 to qt6. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c2 --- Comment #2 from C J <c.j@tuta.io> --- (In reply to C J from comment #1) The wayland Gnome scaling factor introduced some lag to the mouse and a little blur (native is much better) + the screen icc color profiles don't get applied in Gnome settings > Color + some performance seems to be lost in games with wayland. (it's a shame Gnome can't properly render it's UI in 4k. The developers seem to all be using some old low resolution screens, so some scaling hack was introduced so everyone else can use it - but it isn't working well). So, I am back on X11 with the font scaling. -> = back to the original FIRST POST above. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c9 --- Comment #9 from C J <c.j@tuta.io> --- By default qt6 scaling was fine, but qt5 was too big (when using 150% font scaling in Gnome). I was able to fix the qt5 scaling by adding these to /etc/environment
export QT_AUTO_SCREEN_SCALE_FACTOR=0 export QT_SCREEN_SCALE_FACTORS=1.5 export QT_SCALE_FACTOR=1
But now the qt6 mkvtoolnix has the same problem qt5 apps had before. So, either qt5 scaling works or qt6, but not both together. Any idea how to fix this ? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c10 Atri Bhattacharya <badshah400@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |badshah400@gmail.com --- Comment #10 from Atri Bhattacharya <badshah400@gmail.com> --- Created attachment 861758 --> http://bugzilla.opensuse.org/attachment.cgi?id=861758&action=edit Comparison of yast (background) vs qt5 settings app (foreground) under GNOME 200% scaling + 1.25 font-size Same issue here with a 4K display on 14". On my system GNOME automatically sets the UI scaling to 200%; I have additionally set font-size to be 1.25x (from GNOME Settings -> Accessibility -> Large Text). I understand that this gives me a font DPI of 240 by Qt's calculation (96 * 2 * 1.25). Apparently when a DPI of 240 is detected by Qt, this causes some apps to scale up their UI by 3 times instead of 2, making everything look over-crowded. Scale the DPI down just a bit to 239 (or just set `QT_FONT_DPI=239`) and everything looks great. The difference in scaling between DPI 239 and 240 is rather big, see also my report in <https://github.com/veusz/veusz/issues/626>. Tested both on X11 and Wayland. What works correctly is setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough=1` and all Qt5 apps behave correctly even at `QT_FONT_DPI=240`. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c11 --- Comment #11 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to Atri Bhattacharya from comment #10)
What works correctly is setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough=1` and all Qt5 apps behave correctly even at `QT_FONT_DPI=240`.
Sorry, meant `QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough` here. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c12 --- Comment #12 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to C J from comment #9)
By default qt6 scaling was fine, but qt5 was too big (when using 150% font scaling in Gnome).
This is because, according to <https://doc.qt.io/qt-6/highdpi.html#environment-variable-reference> the default scale factor rounding policy for Qt5 is `Round`, while for Qt6 is `PassThrough`. Setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough` ensures you get the same correct scaling across Qt5 apps just as you would by default with Qt6 apps. I do not have Qt6 apps to try this myself, so if you could give this a shot, that would be useful and much appreciated. If you do, please remember to first unset the other QT DPI related env variables you may have set from earlier. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c13 --- Comment #13 from C J <c.j@tuta.io> --- (In reply to Atri Bhattacharya from comment #11)
What works correctly is setting the env variable `QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough` and all Qt5 apps behave correctly even at `QT_FONT_DPI=240`.
YES !!!! This fixes everything ! THANKS ! QT5 & QT6 apps now work properly on Gnome ! *Opensuse devs*, now please get on the ball *URGENTLY* (this was months of struggle and google searches show many have this issue all over) to either upstream the fix to QT or set this env variable globally by default. MANY THANKS. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c14 Atri Bhattacharya <badshah400@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|GNOME |YaST2 Assignee|gnome-bugs@suse.de |yast2-maintainers@suse.de QA Contact|qa-bugs@suse.de |jsrain@suse.com --- Comment #14 from Atri Bhattacharya <badshah400@gmail.com> --- Therefore, this is not a GNOME bug, re-assigning to YaST devs. At the app level, the PassThrough option may be set using `setHighDpiScaleFactorRoundingPolicy()`, see <https://doc.qt.io/qt-5/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy>. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c15 --- Comment #15 from C J <c.j@tuta.io> --- (In reply to Atri Bhattacharya from comment #14)
Therefore, this is not a GNOME bug, re-assigning to YaST devs.
Why only YaST ? This fixes the problem of all QT5 & QT6 apps (not only yast) on Gnome + X11 + hidpi (4k) screens. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c16 --- Comment #16 from C J <c.j@tuta.io> --- (In reply to C J from comment #15)
(In reply to Atri Bhattacharya from comment #14)
Therefore, this is not a GNOME bug, re-assigning to YaST devs.
Why only YaST ?
This fixes the problem of all QT5 & QT6 apps (not only yast) on Gnome + X11 + hidpi (4k) screens.
Thanks.
To add some more info: Other QT apps, like i.ex chessx also have the same problem yast has. (But some apps, like i.ex QT apps built with lazarus don't have the problem). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c17 --- Comment #17 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to C J from comment #16)
(In reply to C J from comment #15)
(In reply to Atri Bhattacharya from comment #14)
Therefore, this is not a GNOME bug, re-assigning to YaST devs.
Why only YaST ?
This fixes the problem of all QT5 & QT6 apps (not only yast) on Gnome + X11 + hidpi (4k) screens.
Thanks.
To add some more info:
Other QT apps, like i.ex chessx also have the same problem yast has.
(But some apps, like i.ex QT apps built with lazarus don't have the problem).
Individual apps have to decide whether to use passthrough by default or not, which may still be over-ruled by an env variable set by the __user__ if they want. Setting a catch-all env variable would be rather ungainly. I think the right way to go about this is to report scaling problems with other apps to the respective upstream and request them to use the passthrough setting or just plain switch to Qt6. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c18 --- Comment #18 from C J <c.j@tuta.io> --- (In reply to Atri Bhattacharya from comment #17)
I think the right way to go about this is to report scaling problems with other apps to the respective upstream and request them to use the passthrough setting or just plain switch to Qt6.
Ok, I have opened Bug 1203792 fox chessx. (In another bug I was told by one of the Suse Gods in charge that users should not contact upstream directly, but we should let you guys handle it). Many thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c21 --- Comment #21 from Atri Bhattacharya <badshah400@gmail.com> --- I am not a GNOME maintainer, to begin with, so spare those good people your wrath. More to the point, Qt apps such as YaST that do not set PassThrough in their app explicitly are the ones that suffer, because the default Qt 5.15 scale rounding policy is to 'Round'. Nothing to do with GNOME. And yes, if you set the environment variable 'QT_SCALE_FACTOR_ROUNDING_POLICY="PassThrough"', to get around this (whether in the installation DE or in KDE) that is just plain wrong. That variable should be left to the user to set in case something does not look right to them. Indeed, even if the app sets its own PassThrough policy, the QT_SCALE_FACTOR_ROUNDING_POLICY env variable, if set by the user, takes precedence. But you believe this is not YaST's to fix, fine; that opinion is precisely why I thought of getting YaST devs into the loop. No intent to dump anything on your lap maliciously, sorry if that is what you felt. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c22 Luciano Santos <luc14n0@opensuse.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luc14n0@opensuse.org Found By|--- |Community User --- Comment #22 from Luciano Santos <luc14n0@opensuse.org> --- (In reply to Stefan Hundhammer from comment #19)
As the screenshots clearly show, this affects ALL Qt5 applications, so how could this possibly be a problem of YaST?
...
I don't know how GNOME wants to handle this. We found our solution for the YaST installation; but we intentionally did not override this for the desktops as well. A user might choose to override any of those values, and we don't want to interfere with that.
Right here and now, a user might choose to set those environment variables directly. It might take a while until the desktops catch up with this.
Could you guys please reconsider this? I know the YaST team has a lot to take care already but actually this issue doesn't affect _all_ Qt5 apps. The common pattern here seems to be Qt apps not making use of setHighDpiScaleFactorRoundingPolicy() in the code to set the PassThrough option. And, from what was already pointed here, setting this in the code won't take precedence over environment variables, like QT_SCALE_FACTOR_ROUNDING_POLICY=WhateverSuitsMeBetter. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c24 --- Comment #24 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to Stefan Hundhammer from comment #23)
Whenever we do any change in that area, there are some few users that we make happy, and a much larger group that is mad at us because it no longer works for them.
Clearly you think ��� as well as Qt devs, for otherwise it wouldn't have been the default policy for Qt6 already ��� that, at least as of Qt 5.15, the PassThrough policy works best for YaST. You choose to implement it for the installation DE by means of an env variable because it works better. Then, in the installed system, you let the desktop decide on this, which leads to the app looking different in different DE's. Pray tell me why GNOME should set "QT_" anything for environment variables for any app to look reasonable?
We did not change the behavior in the installed system because after many years of constantly changing, things seemed to have settled down: The desktops tend to have a setting somewhere for a scale factor, typically resulting in setting something like the Xft.dpi X resource with xrdb (see bug #1123424 for example).
Please remember that this is not only for HiDPI; it's also for questionable choices by GUI designers who select tiny fonts that users with vision problems cannot read.
If we were to change it yet again in, say, the /sbin/yast2 start script, for sure a large number of users will complain. And it will work differently in different desktops, too. What about KDE Plasma? What about all the GNOME derivatives like Xfce, Mate and whatever? What about Enlightenment and all the others? Do they all behave the same? I don't believe that.
Some apps don't behave the same across desktops right now because they are depending on env variables to fix issues that should be fixed in-app. When the app sets its policy to PassThrough, it will behave exactly the same way across desktops unless an especially weird desktop forces the env variable QT_SCALE_FACTOR_ROUNDING_POLICY=Round; AFAIK none of them does that. None of the discussion here affects non-HiDPI systems. Neither "Qt::AA_EnableHighDpiScaling", nor 'setHighDpiScaleFactorRoundingPolicy()', nor the env variables specifically in question here have any effect on dpi=96 systems.
As for all Qt5 apps or not: To support any of that scaling at all, a Qt application needs to set certain flags when initializing Qt; e.g.
https://github.com/libyui/libyui/blob/master/libyui-qt/src/YQUI.cc#L159
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
(and there are several more that are very similar). Some apps set those flags, some don't. Many are probably not even aware of the problem.
We are not talking about apps that do not set HiDPI scaling at all, those look awful on HiDPI systems anyway. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c27 --- Comment #27 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to Stefan Hundhammer from comment #25)
The bug reporter explicitly wrote that it works fine on KDE Plasma in comment #5. So there is a difference in how KDE handles this vs. how GNOME handles it. What that difference is I don't know.
Disclaimer: I have never used KDE >= 4 before, so my understanding in what follows may be off target. Obviously KDE being a Qt based DE does this differently. On my HiDPI VM, I fired up the Tumbleweed KDE Live disk and found that nothing is scaled by default in the first place. The ��� apparently now outdated ��� variable QT_AUTO_SCREEN_SCALE_FACTOR=0 is set by default by the DE. The user has to go in to settings and manually change the display scaling to whatever looks ok on their screen; on mine I adjusted it to 2.5 (4k display on 14.1" is too much, plus my rather poor vision forces this), which then sets the following additional env variable in my user profile: QT_SCREEN_SCALE_FACTORS=2.5. In addition the option "Settings -> Appearance -> Fonts -> Force Font DPI" is fixed by default to 96*`QT_SCREEN_SCALE_FACTORS` (240 in my case). This forces the scaling to be fixed to DPI 240 or whatever without Qt's default rounding policy to be applied. Provided my understanding above is correct, do you really expect DE's that have nothing to do with Qt to go through all these Qt env variable gymnastics? That too where, often, the only Qt app I am running on my GNOME system is just your YaST, only because I _have_ to and it provides no GTK interface?
The title of the second screen shot is "...GNOME 200% scaling + 1.25 font-size". So this might as well be wrong expectations from the side of the bug reporter: To me it looks as if the 200% scaling part worked as requested; but not the 1.25 font size. How would that information get to any Qt programs running on that setup?
Yes the font scaling does get through to Qt apps. It gets through by means of the font DPI, but you can try chaing the font scaling manually from 1.0 to 1.1 to 1.2 to 1.25 and see for yourself that Qt apps _do_ take into account these changes. It is just that when the DPI becomes a certain value, Qt rounds it up to the next 100, thus rendering some apps ginormous.
The other screen shot is from the yast Qt control center; a very simplistic standalone Qt application that is only very loosely connected to YaST. In particular, it does not use any of the YaST UI toolkit infrastructure, just plain Qt.
This is really the point. Even the simplest app that uses Qt (>= 5.14, < 6) and allows hidpi scaling reverts to rounding up fractional scaling factors to an integer by default. This the makes the app look too large/crowded in desktop environments that do not ��� and should not ��� set "QT_*" related HiDPI env variables. Anyway, my final comment here: you (plural and not you personally of course, but any app developers) are responsible for how your app looks in multiple settings including DE's (and even other OS's). I believe we understand a little better why YaST and some other Qt apps (not all) look too big under some circumstances in non-KDE DE's. I believe we know a potential one-line fix (which I can, if you ask, make a PR on YaST's GitHub repo) at the app level to make said app look consistent no matter the DE. That is all. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c29 --- Comment #29 from Atri Bhattacharya <badshah400@gmail.com> --- (In reply to Stefan Hundhammer from comment #28)
But when we start messing with all those little details in every single application, things are bound to go downward fast. I am convinced that this needs to be done on the toolkit level (Qt / Gtk / ...)
It (setting PASSTHROUGH by default) _has_ been done at the Qt level with Qt version 6 already. YaST is Qt5 still, however.
I personally have no strong opinion if we should round to integers or allow multiples of 0.25 or whatever; but what we really can't do anymore (because it's really embarrassing) is fonts everywhere that are either tiny or huge with nothing in between. Yet that is what users constantly complained about.
Yes, you keep making the argument in favour of setting 'PassThrough' (as described earlier) at the app level for your Qt5 app over and...
YaST needs to work smoothly with all major desktops, plus in the inst-sys where there is only a very minimalistic infrastructure. So we can't simply set anything to fixed values; some users will definitely complain.
...over. Anywho, thanks for the lively back and forth. I always appreciate different perspectives. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 Atri Bhattacharya <badshah400@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|badshah400@gmail.com | -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c31 --- Comment #31 from C J <c.j@tuta.io> --- After today's update (to snapshot 20221016 or perhaps was it 20221015) "export QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough" in /etc/environment doesn't have any effect anymore. -> All the QT5 apps (including yast) that were too big are now too big again, with and without QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough. QT6 apps still don't have any problem. Does anyone know what happened ? What a mess... Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c32 --- Comment #32 from C J <c.j@tuta.io> --- (In reply to C J from comment #31)
After today's update (to snapshot 20221016 or perhaps was it 20221015) "export QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough" in /etc/environment doesn't have any effect anymore.
After some more testing it seems that the variables exported in /etc/environment aren't applied anymore, because starting an app with "QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough" in gnome-terminal WORKS. I have opened Bug 1204434 for this. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 http://bugzilla.opensuse.org/show_bug.cgi?id=1202837#c33 --- Comment #33 from C J <c.j@tuta.io> --- (In reply to C J from comment #31)
After today's update (to snapshot 20221016 or perhaps was it 20221015) "export QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough" in /etc/environment doesn't have any effect anymore.
Removing the word "export" fixed this. (It always worked before and suddenly stopped working after an update. Requiring hours of searching and testing. This is Linux for you. Why? Because someone screwed things up and didn't inform anyone. What an unstable shitshow.). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1202837 Atri Bhattacharya <badshah400@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|badshah400@gmail.com | Flags|needinfo?(badshah400@gmail. | |com) | -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com