Reset zoom cursor more reliably
Summary:
In View mode a magnifying glass is shown while pressing Ctrl
to indicate the image's zoom level could be changed in that state.
Restoring the regular cursor after the user stopped holding the modifier
relied on AbstractImageView::keyReleaseEvent. However, that event is
not guaranteed to be delivered, e.g. when another window got focus
before releasing the modifier.
The issue can be mitigated by updating the cursor more eagerly for focus
changes.
FIXED-IN: 18.04.3
Test Plan:
- In View mode with the cursor over the image, press Ctrl+O and close the dialog again.
- With the "focus follows mouse" policy set, hold Ctrl while moving the cursor to another window, release the modifier and move the cursor back to Gwenview.
- With focusing on another application, press Ctrl, move cursor back to Gwenview and focus the window while still holding the modifier.
In all cases the zoom cursor should be set correctly according to the actual keyboard state.
Reviewers: Gwenview, muhlenpfordt
Reviewed By: Gwenview, muhlenpfordt
Subscribers: muhlenpfordt
Differential Revision: https://phabricator.kde.org/D13894