Bug 444990 - Shortcut conflicts when filename contains number
Summary: Shortcut conflicts when filename contains number
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 01:58 UTC by Peifeng Yu
Modified: 2021-11-21 12:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The tab bar while pressing the alt key (52.32 KB, image/png)
2021-11-05 01:58 UTC, Peifeng Yu
Details
The tab bar while pressing the alt key (94.81 KB, image/png)
2021-11-05 02:00 UTC, Peifeng Yu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peifeng Yu 2021-11-05 01:58:15 UTC
Created attachment 143223 [details]
The tab bar while pressing the alt key

SUMMARY
In Okular by default, you can use Alt+1, Alt+2, etc. to activate annotation tools. However, when you have multiple files open, and there are numbers in the filenames, Alt+1, etc. may be assigned as the tabview keyboard accelerator to switch tabs.

In the attached screenshot, it can be seen that the last document "Statement-2021-10.pdf" has "1" underlined, suggesting it is used as the accelerator key.

STEPS TO REPRODUCE
1. Open several documents in Okular
2. Make sure one of them gets assigned an accelerator key by pressing alt and see which char is underlined in the tab bar
3. Press Alt+1

OBSERVED RESULT
If the current tab is not the one with filename containing "1", Okular will switch to that tab.
If already on that tab, an "ambiguous shortcut detected" warning shows up and nothing happens.

EXPECTED RESULT
Alt+1, Alt+2, etc. always activates the corresponding annotation tool, regardless of filenames of currently opened documents.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.16-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics
Comment 1 Peifeng Yu 2021-11-05 02:00:38 UTC
Created attachment 143224 [details]
The tab bar while pressing the alt key
Comment 2 Bug Janitor Service 2021-11-05 22:25:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/105
Comment 3 Albert Astals Cid 2021-11-21 12:30:02 UTC
Git commit 294fe8ddc2f10d0a783bf9b80769c31ecc5922b1 by Albert Astals Cid.
Committed on 21/11/2021 at 12:27.
Pushed by aacid into branch 'master'.

KAcceleratorManager: Take into account actions with Alt+X shortcuts

We need to mark those X labels as used, otherwise the accelerator
manager may decide to use X for an accelerator and when pressing Alt+X
we will have a conflict

M  +21   -0    autotests/kacceleratormanagertest.cpp
M  +23   -7    src/kacceleratormanager.cpp
M  +2    -2    src/kacceleratormanager_p.h

https://invent.kde.org/frameworks/kwidgetsaddons/commit/294fe8ddc2f10d0a783bf9b80769c31ecc5922b1