Skip to content

Use device pixel ratio for the correct screen

Oliver Sander requested to merge sander/okular:use-more-per-screen-dpr into master

The method qApp->devicePixelRatio() should only be used under special circumstances. The documentation of QGuiApplication says:

"Returns the highest screen device pixel ratio found on the system. [...] Use this function only when you don't know which window you are targeting. If you do know the target window, use QWindow::devicePixelRatio() instead."

The Okular code used qApp->devicePixelRatio() a few times without reason. Few people noticed this, because apparently only Windows and Wayland can set per-screen dprs. This patch replaces those calls with the correct QWindow call.

Merge request reports

Loading