Merge pull request #662 from gaul/screen/none

Handle None from QApplication.desktop().screen()
This commit is contained in:
Damien Elmes 2020-06-09 14:42:59 +10:00 committed by GitHub
commit 3275aff335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -37,6 +37,7 @@ Henrik Giesel <hengiesel@gmail.com>
Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
Sander Santema <github.com/sandersantema/>
Thomas Brownback <https://github.com/brownbat/>
Andrew Gaul <andrew@gaul.org>
********************

View file

@ -302,6 +302,9 @@ class AnkiWebView(QWebEngineView):
if isMac:
return 1
screen = QApplication.desktop().screen()
if screen is None:
return 1
dpi = screen.logicalDpiX()
factor = dpi / 96.0
if isLin: