Skip to content
  • rk flx's avatar
    Reset zoom cursor more reliably · 84e6a0a9
    rk flx authored
    Summary:
    In {nav View} mode a magnifying glass is shown while pressing {key 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 {nav View} mode with the cursor over the image, press {key Ctrl O} and close the dialog again.
    - With the "focus follows mouse" policy set, hold {key Ctrl} while moving the cursor to another window, release the modifier and move the cursor back to Gwenview.
    - With focusing on another application, press {key 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
    84e6a0a9