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

Fix High Dpi Support. Works now under Windows and KDE/Plasma. #392

Merged
merged 1 commit into from
May 12, 2018

Conversation

hgraeber
Copy link
Contributor

Commit 4a53082 was incomplete...

Qts scaling environment variables shall never be changed by application.
That way the user hasn't any chance to fix things himself. With setting
QT_AUTO_SCREEN_SCALE_FACTOR to 1 QtPass does not work under KDE/Plasma
and cannot even be fixed by setting Qts scaling environment variables.

Commit 4a53082 was incomplete...

Qts scaling environment variables shall never be changed by application.
That way the user hasn't any chance to fix things himself. With setting
QT_AUTO_SCREEN_SCALE_FACTOR to 1 QtPass does not work under KDE/Plasma
and cannot even be fixed by setting Qts scaling environment variables.
@hgraeber hgraeber changed the title Fix High Dpi Support. Works now under Windows ande KDE/Plasma. Fix High Dpi Support. Works now under Windows and KDE/Plasma. May 11, 2018
@FiloSpaTeam
Copy link
Contributor

I suggest this code:

#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#else
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
#endif

@hgraeber
Copy link
Contributor Author

@FiloSpaTeam Why. The only reason can be that Qt 5.6s HighDPI is broken.

By forcing the QT_AUTO_SCALE_FACTOR environment variable to a fixed value you will break it even more, because it is not possible anymore to use the variable outside of QtPass to fix the behavior on some platform where HighDPI misbehaves.

So I can only repeat: It is better to never change those environment variables inside of the program.

@FiloSpaTeam
Copy link
Contributor

@FiloSpaTeam
Copy link
Contributor

This is introduced in Qt 5.6 and Debian uses Qt 5.2/3 so they cannot compile.
Se have not defined a minimal Qt version so we should be compatible

@hgraeber
Copy link
Contributor Author

@FiloSpaTeam With Qt before 5.6 HighDPI is broken anyways. For distributions using those old version I would expect that they patch it themself. I think they already have many other patches of this type inside of their packages and HighDPI still doesn't work completely right anyways.

@codecov
Copy link

codecov bot commented May 11, 2018

Codecov Report

Merging #392 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #392      +/-   ##
=========================================
+ Coverage    6.49%   6.49%   +<.01%     
=========================================
  Files          39      39              
  Lines        2557    2556       -1     
=========================================
  Hits          166     166              
+ Misses       2391    2390       -1
Impacted Files Coverage Δ
main/main.cpp 0% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f6f753...59adb7c. Read the comment docs.

@coveralls
Copy link

coveralls commented May 11, 2018

Coverage Status

Coverage remained the same at 6.422% when pulling 59adb7c on hgraeber:master into 3f6f753 on IJHack:master.

@annejan annejan merged commit 4ad1e55 into IJHack:master May 12, 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

Successfully merging this pull request may close these issues.

4 participants