Bug 420525 - missing keyboard shotcuts since 20.04
Summary: missing keyboard shotcuts since 20.04
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 20.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Laura David Hurka
URL:
Keywords:
: 420546 420880 420909 420948 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-04-24 21:12 UTC by Kevin
Modified: 2020-10-29 12:59 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.04.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin 2020-04-24 21:12:32 UTC
The most recent version of Okular (20.04 / 1.10) seems to have dropped the keyboard shortcuts for Single Page, Facing Page, and probably others also. These shortcuts no longer appear in the "Configure Keyboard Shortcuts..." settings. These shortcuts existed in previous versions of Okular. Could these shortcuts please be added back?
Comment 1 Yuri Chornoivan 2020-04-25 08:52:33 UTC
*** Bug 420546 has been marked as a duplicate of this bug. ***
Comment 2 Brian Liu 2020-04-25 08:57:12 UTC
(In reply to Kevin from comment #0)

I totally agree. Single Page, Facing Pages, and Facing Pages (Center First Page) were so useful. I didn't know someone already noted this bug because it didn't pop up under possible duplicates until Yuri marked it. But please bring this back the absence of that option as a shortcut is hurting our productivity and I might even try to switch to an old version of Okular if it's not added back because it was so useful.
Comment 3 Laura David Hurka 2020-04-25 10:15:39 UTC
Bug reports let me feel so silly this week. I broke this when I moved the Continuous action to the view mode menu. Sorry...

I submitted an MR to fix this.
Comment 4 Brian Liu 2020-04-25 10:19:08 UTC
(In reply to David Hurka from comment #3)

Thank you so much for your prompt response and initiative to fix it. Sorry if anything I said felt harsh. Don't feel bad, Okular is my favorite document viewer :)
Comment 5 Laura David Hurka 2020-04-25 10:28:56 UTC
Don’t worry, both your bug reports are excellent, and you didn’t hurt me. :) It’s just that my patch back then caused other bugs too.

Unfortunately, until the next bugfix release of Okular, your only options are:
1. Install Okular 19.12[.3]
2. Compile Okular from git master, with davidhurka/fix-view-mode-action-names applied
3. Add the View Mode menu to the toolbar and use that instead
4. Wait for the bugfix release
Comment 6 Antonio Rojas 2020-04-25 10:49:37 UTC
(In reply to David Hurka from comment #5)
> Don’t worry, both your bug reports are excellent, and you didn’t hurt me. :)
> It’s just that my patch back then caused other bugs too.
> 
> Unfortunately, until the next bugfix release of Okular, your only options
> are:
> 1. Install Okular 19.12[.3]
> 2. Compile Okular from git master, with
> davidhurka/fix-view-mode-action-names applied
> 3. Add the View Mode menu to the toolbar and use that instead
> 4. Wait for the bugfix release

5. Ask your distribution to backport the fix (once it's merged)
Comment 8 Kevin 2020-04-25 18:16:29 UTC
Thanks for fixing this so quickly!
Comment 9 Yuri Chornoivan 2020-05-02 05:53:17 UTC
*** Bug 420880 has been marked as a duplicate of this bug. ***
Comment 10 Yuri Chornoivan 2020-05-02 16:30:37 UTC
*** Bug 420909 has been marked as a duplicate of this bug. ***
Comment 11 Yuri Chornoivan 2020-05-03 12:14:07 UTC
*** Bug 420948 has been marked as a duplicate of this bug. ***
Comment 12 Brian Liu 2020-05-04 22:53:04 UTC
(In reply to Kevin from comment #8)
> Thanks for fixing this so quickly!
I downloaded the updated version but still couldn't find Single Page, Facing Page, etc. under Configure Keyboard Shortcuts.
Comment 13 Kevin 2020-05-05 00:04:04 UTC
Brian, I do not think an updated version has been released yet. I just tried compiling from git, and I can confirm that the hotkeys worked for me.
Comment 14 Laura David Hurka 2020-06-25 06:02:06 UTC
@Brian: I hope a newer release works for you. If not, please re-repoen this. :)
Comment 15 Brian Liu 2020-07-12 08:33:34 UTC
(In reply to David Hurka from comment #14)
> @Brian: I hope a newer release works for you. If not, please re-repoen this.
> :)

Hi, thanks for the message. Unfortunately the new release still doesn't work in terms of restoring the option of setting a shortcut for Single Page, Facing Pages, and Facing Pages (Center First Page). Also there seems to be a problem with most epub files in that the background and text are both dark by default; should I start a new thread for that or am I missing something obvious?
Comment 16 Laura David Hurka 2020-07-12 18:35:30 UTC
Thanks to you, I have learned how to trigger KActionCollection contents through gdb. ;) It would probably be easier through D-Bus, if it was exposed there.

Note that some shortcuts are not applied until a restart, due to another bug.

The black background problem is very likely not related.

If the actions don’t appear in Configure Shortcuts and Configure Toolbars, you could use this procedure to see whether they exist in the action collection:

1. You need KF5 KXMLGui, Qt5 core, Qt5 gui, Qt5 widgets, Okular debugging symbol packages installed. You need gdb for your local system, usually just called “gdb”.

2. Start Okular:
$ gdb okular
(gdb) start
(gdb breaks at main function)
(gdb) continue

3. Open a document with enough pages and select Facing Pages.

4. Type view_render_mode_single in the find bar (Ctrl-F), we will use that string to fetch the action.

5. Go back to the gdb console and set a breakpoint at the Find Next button:
Ctrl-C
(gdb) break FindBar::findNext
(gdb) continue

6. Click the Next button.

7. Get the address of the FindBar object:
(gdb) print this
$1 = (FindBar * const) 0x555555a314f0

8. Break somewhere inside PageView:
(gdb) break PageView::mouseMoveEvent
(gdb) continue

9. Move your mouse over the Okular window, gdb will catch the breakpoint. Then:
(gdb) print actionCollection()->action(((FindBar*)0x555555a314f0)->text())->trigger()
(You need to adjust the pointer to what was printed in step 7.)

10. Observe the results (if not crashed in step 9):
(gdb) continue

11. Quit Okular. To quit gdb:
(gdb) quit
y

The intended result is that Okular switches to Single Page view mode. Release 20.04.0 should switch to Overview mode. If the action does not exist in the action collection, Okular should segfault at step 9, and we have to figure out how the action got lost.
Comment 17 Luke Midworth 2020-10-29 01:26:43 UTC
Hi, I've been using Okular for a long while, as it's by far the most full-featured PDF reader and annotator available. However, I haven't been able to upgrade past version 19.12.3 because I rely on the following keyboard shortcuts to quickly adapt to different document types and page layouts on a multi-monitor setup:

view_render_mode_single=Ctrl+1
view_render_mode_facing=Ctrl+2
view_render_mode_facing_center_first=Ctrl+3

and these shortcuts are no longer recognised at higher version numbers.

I believe this is the correct bug report for this issue, and I'd like to help solve it, as I'm worried that eventually my out-of-date version of Okular will stop working. I'm using Manjaro Cinnamon, rather than KDE, so I don't have a lot of the tools mentioned in comment 16, but I'm keen to contribute any information I can to fixing this regression.

Thanks!
Comment 18 Laura David Hurka 2020-10-29 09:28:50 UTC
This is the correct bug report for this issue.

Did you already upgrade to a newer version than 19.12.3?

If you upgrade to 20.04.0, these shortcuts will not work because the mentioned actions are missing.

If you upgrade to a later version, everything should work fine. Note that newly configured shortcuts are not recognized until a restart of Okular.

But if you upgrade to 20.08.0 or newer, you will lose all shortcuts, and have to reconfigure them manually. This is because we added a new toolbar, and KXMLGUI doesn’t provide a way to add toolbars to existing configurations. We didn’t find a better way than to delete part.rc, which defines toolbars and shortcuts.
Comment 19 Luke Midworth 2020-10-29 09:57:02 UTC
I had previously upgraded to 20.04 and wasn't able to define the shortcuts, but I've just upgraded to 20.08 and you're absolutely right, I just had to manually redefine them rather than import my saved shortcut scheme from 19.12.3. Thanks so much for your prompt and comprehensive reply, and thanks for creating and maintaining an excellent PDF reader!
Comment 20 Laura David Hurka 2020-10-29 12:57:50 UTC
> import my saved shortcut scheme
Oh, just learned a new feature. Thanks. :)
Comment 21 Laura David Hurka 2020-10-29 12:59:22 UTC
Anyway, importing a saved scheme should work. AFAIK the action names are the same as before.