Bug 408075 - Okular flips pages if history is exhausted while using the back / forward keyboard shortcuts
Summary: Okular flips pages if history is exhausted while using the back / forward key...
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.7.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-29 16:18 UTC by Kishore Gopalakrishnan
Modified: 2020-11-04 15:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2019-05-29 16:18:03 UTC
SUMMARY
Okular binds the alt+shift+left/right shortcuts to the 'back' and 'forward' items by default. If the history is exhausted (i.e. we navigate back/forward till there are no more locations left), okular starts moving to the next/previous page, acting as if we have pressed just the left/right arrow key.

STEPS TO REPRODUCE
1. Open a PDF in Okular.
2. Add the back and forward buttons to the toolbar (this is just to illustrate the issue)
3. Note that the 'forward' button is greyed out.
4. Press Alt+Shift+Right (forward). 
5. Note that Okular moves forward one page.
6. Now scroll up and down to populate the history.
7. Press Alt+Shift+Left until the history of previous locations is exhausted. At this point, the 'back' button will be greyed out and unclickable.
8. Press Alt+Shift+Left
8. Note that this causes Okular to move one page back (as if we had just pressed the left arrow key)

OBSERVED RESULT
Okular flips pages when there is nowhere to go to in the history.

EXPECTED RESULT
Okular should do nothing if history is exhausted (i.e. after steps 8 and 4).

SOFTWARE/OS VERSIONS
Linux distro: Arch Linux
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58.0
Qt Version: 5.13.0

ADDITIONAL INFORMATION
This is reproducible only if the shortcut contains an arrow key. If we bind something like ctrl+9 to 'forward', Okular shows the expected behaviour. Prima facie, it looks like Okular doesn't correctly handle the keypresses corresponding to a shortcut if the shortcut corresponds to an action that cannot be performed (like going 'forward' when we are at the most recently veiwed location).
Comment 1 Alex 2020-11-04 12:09:27 UTC
The bad behavior occurs not only when the history is exhausted but always. Lets say I'm reading a paper and click some link to a reference in the Introduction, then it takes me to the References section, good! Then if I immediately click 'back' it takes me to the previous page, not to the Introduction that is what I expect.
Comment 2 Kishore Gopalakrishnan 2020-11-04 12:58:19 UTC
(In reply to Alex from comment #1)
> The bad behavior occurs not only when the history is exhausted but always.
> Lets say I'm reading a paper and click some link to a reference in the
> Introduction, then it takes me to the References section, good! Then if I
> immediately click 'back' it takes me to the previous page, not to the
> Introduction that is what I expect.

I think that's a different bug (bug 414701)