-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Display properly on a HiDPI screen #4800
Conversation
Thank you for the contribution! However, I believe #3814 already addresses what you want to achieve. |
PR #3814 doesn't work (I actually tested it doesn't work). I suspect setAttribute is done too late. It has to be done before the QCoreApplication constructor. |
Does the new patch work properly? I can't test it now. |
Yes it does. But then it need to be reworked to remove the code that doesn't work. I'll do that later. |
@@ -8,7 +8,7 @@ Comment=Music sequencer and synthesizer | |||
Comment[ca]=Producció fàcil de música per a tothom! | |||
Comment[fr]=Production facile de musique pour tout le monde ! | |||
Icon=lmms | |||
Exec=env QT_X11_NO_NATIVE_MENUBAR=1 QT_AUTO_SCREEN_SCALE_FACTOR=1 lmms %f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to documentation, setting QT_AUTO_SCREEN_SCALE_FACTOR=1
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but not having to set it is better. And this would make thing not work if lmms was launched differently (ie from the command line).
Which is why the previous change might have been considered working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but not having to set it is better.
That reason does not convince me. We could drop QT_X11_NO_NATIVE_MENUBAR=1
, but we do not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is my rationale:
HiDPI should work out of the box. Nothing to do for the user. QCoreApplication::setAttribute()
didn't work before, it does now with the patch, make the environment variable QT_AUTO_SCREEN_SCALE_FACTOR=1
is not needed anymore. Adding it in the .desktop is only useful when the .desktop is used, which is not ideal.
FWIW, I submitted similar patches to Muse Sequencer and Rosegarden and they got accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should detect whether the screen is HiDPI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qt does that for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Qt documentation says setting Qt::AA_EnableHighDpiScaling
before constructing QGuiApplication
is equivalent to setting QT_AUTO_SCREEN_SCALE_FACTOR
to 1, as @jasp00 said. However, I agree more with #4800 (comment). It'd be definitely better to have one which should always work and drop another fix which works only in some situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a fix. It is an opt-in feature that may incur some scaling or painting artifacts. See "Migration of Existing Applications" for the real fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you were ready to have it except it wasn't properly activated. And without that you can't start fixing said artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm moving this conversation to the conversation area, where it really belongs.
Agreed.
Agreed, this is how it works on Mac. I'm curious.. will this fix the same issue for Windows clients?
That change was reverted in the AppImage actually. Apparently we (I) forgot to follow suit in the desktop icon. 22124dd Anyway, I've had to switch to |
I'm testing Ubuntu 18.04 w/ Qt 5.9 on a Dell XPS 13 and I can't get either technique to change anything on this machine. I'm only attaching one screenshot because all tests were identical. Note this display requires fractional scaling, it's not 2:1 like a Retina display. I have a VM in Parallels on a Apple Retina display that suffers from the inconsistent scaling which I've seen people complain about with the AppImage. I'll test that next with both this PR and the |
About compatibility, if Lmms is built on Qt < 5.6, this won't work, even if run on >= 5.6 |
Understood, I'm talking about the possibility of Qt addressing fixes between Qt 5.6 and now. No matter what I do, I can't get Ubuntu 18.04 to recognize the |
An interesting write-up: https://vicrucann.github.io/tutorials/osg-qt-high-dpi/ |
@hfiguiere what Qt version are you using? |
So I just stumbled upon this bug report: linuxmint/cinnamon#4902 The issues are very similar to ours. One person recommended this:
Strangely, this fixes scaling for my retina display. I have a feeling that newer (Qt > 5.9) versions behave differently but I'll need to do more testing to confirm this. |
In the Flatpak it is Qt 5.12. |
That may be the difference then. I'll test against 5.12 now. |
Fedora 29 has 5.11.3 FWIW. And it works the same. |
Upgrading to QT 5.12 does not appear to make a difference on my machines. The above workaround is still the only setting that fixes the scaling on my retina display in VM. Same for the XPS 13 (fractional scaling). The good thing is, this PR doesn't make anything worse. |
@hfiguiere are you on Wayland or X11? |
Wayland. It's the default on Fedora. |
Thought so. Can you see if you experience the same improvements using X11? My XPS requires fractional scaling (e.g. 125%) which I'm starting to believe is not supported in much except Windows. To switch to X11 usually just requires logging out, clicking the gear and selecting X11 or whatever Fedora calls it. AFAIR the gear will only show if you have a password. My VM is running inside Parallels which is currently incapable of using Wayland. I'd like to know if the display server is a factor. |
I booted Ubuntu 18.04 to X11 natively on the MacBook Pro with Retina (200%) and can confirm that this patch fixes the scaling issue. I can also confirm that it's functionally equivalent to the In regards to the This PR should be merged. |
Do you still want that? |
Want what? |
Remove |
Ideally. It makes our launcher harder to use out of the box with |
I will make a request after this one is merged. |
Per discussions above:
Despite all of this, there was push back when this was set in the AppImage, so we should expect some pushback for edgecases where this setting makes things worse. We'll do our best to reproduce on similar hardware and handle accordingly. Merging. |
With this LMMS display properly on a HiDPI screen