This creates CursorWrapHelper, which wraps the cursor
from e. g. top screen edge to bottom screen edge,
and calculates the drag offset from the actual cursor movement.
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.
Right now Okular defaults to opening an already-open document in a new
tab when opened a second time, which is a bit odd. Most other
document-based apps will switch to the existing document's instance
instead of opening a new instance of it.
Interestingly enough, Okular has an option to do this, but it's off by
default. I think on by default makes more sense here, to be consistent
with other document-based apps. Since the option exists, people who have
a specialized use case that commonly involves opening multiple instances
of the same document can toggle the option to have that. Everyone wins!
BUG: 432942
FIXED-IN: 21.04
The PixmapRequest constructor expected width and height in logical
pixels, and scaled them to device pixels. However, not knowing what
screen the request is for, it had to use qApp->devicePixelRatio()
for the scaling. That value may not be correct if not all screens
use the same scaling.
Fix this by introducing a new constructor that takes the device
pixel ratio as an additional argument, and deprecating the old
constructor.
It's already bad enough that the copyright claims and the about dialog
has obsolete info, we don't need yet another place where there's
obsolete info.
People interested in AUTHORS can read the git log