Bug 428257 - Closing tabs changes focus to sidebar which breaks Ctrl+Tab
Summary: Closing tabs changes focus to sidebar which breaks Ctrl+Tab
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.11.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-26 06:50 UTC by Unknown
Modified: 2020-10-28 18:42 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2020-10-26 06:50:54 UTC
SUMMARY
Ever since the new sidebar update, when closing a tab the selection reverts back to the sidebar "tabs". This prevents me from pressing Ctrl+Tab to switch document tabs, and it annoying.

I'm not sure exactly what causes it, but sometimes the focus goes to the sidebar tabs, or sometimes to the document number, or something else. Seems to sometimes happen without even closing a tab?

STEPS TO REPRODUCE
1. Open three tabs with documents
2. Close one tab
3. Hit ctrl+tab to switch (note: somewhat fickle)

OBSERVED RESULT
Selection of another part of okular window.

EXPECTED RESULT
Ctrl+Tab switches tabs.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.9.1-arch1-1
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 530

ADDITIONAL INFORMATION
Comment 1 Justin Zobel 2020-10-26 09:23:07 UTC
I'm on KDE Neon Unstable and the default shortcuts to switch between documents open in tabs are:
Ctrl Page Down / Up
or
Ctrl [ / ]

Can you please confirm these work?
Comment 2 Albert Astals Cid 2020-10-26 22:05:46 UTC
Justin, he is not speaking anything about the default shortcuts, what he says is easily reproduceable and i agree, closing a tab should not send the focus to a different place from where it was, ideally
Comment 3 Bug Janitor Service 2020-10-26 22:52:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/302
Comment 4 Unknown 2020-10-27 06:30:02 UTC
I didn't even realise Ctrl+Tab wasn't the default shortcuts for switching tabs. Ctrl PageUp does work, so yeah seems like just a focus issue.
Thanks for the quick MR :)
Comment 5 Albert Astals Cid 2020-10-28 00:08:25 UTC
Git commit 91dbaa1f5bbff9a50b67b2c165f30f5b4a7f437a by Albert Astals Cid.
Committed on 27/10/2020 at 22:37.
Pushed by aacid into branch 'master'.

Set focus to the next current tab when closing the current tab

And by that it means giving the focus to the pageview which is most of
the fimes what we want. One could argue that if i had the focus on the
searchbar we should restore the focus there, but that makes not much
sense to me, since each tab is it's own world, at most one could say,
let's remember where the focus was in that tab the last time it was
focused and restore it there, but it seems a bit convoluted.

To be able of setting the focus to the pageview from the shell we need
to set up some focus proxies, so that part->widget (which is the sidebar)
ends up giving the focus to the pageview, which is what makes sense if
someone says "you part, set yourself the focus"

M  +1    -0    part.cpp
M  +12   -0    shell/shell.cpp
M  +1    -0    ui/sidebar.cpp

https://invent.kde.org/graphics/okular/commit/91dbaa1f5bbff9a50b67b2c165f30f5b4a7f437a