SUMMARY Okular recently got the feature to close tabs by middle click. However, this also happens on the sidebar tab bar. STEPS TO REPRODUCE 1. Open a document 2. Middle-click on Thumbnails tab OBSERVED RESULT Document vanishes EXPECTED RESULT Nothing SOFTWARE/OS VERSIONS KDE Neon 5.19 KDE Plasma Version: 5.74.0 Qt Version: 5.14.2
Hmm, cannot reproduce.
Created attachment 131778 [details] Manually shown tab bar I debugged it for you: Shell::eventFilter() listens to event of the whole main widget, and then tries to get the tab under the event. In the screenshot we see the tab bar after manually invoking show(). Mouse events on the sidebar tab bar happen to match the position of the hidden tab. This bug was not visible in older versions, because there was no tab bar, but the line edit, which accepts middle clicks. A simple and clean solution is to make Shell::eventFilter() listen to the actual tab bar (not the tab widget), because that can’t promote events when it is hidden. Another clean solution is to make the tab bar process middle clicks itself.
And of course remove the Q_UNUSED()...
Good sleuthing!
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/304
Git commit 924a5fb9fcb23a88d3b18bfd3c64f6102a482b88 by Albert Astals Cid. Committed on 26/10/2020 at 23:36. Pushed by aacid into branch 'release/20.08'. Fix middle click on sidebar tab bar unloads the document. Filter the exact widget we care about for middle mouse buttons M +2 -4 shell/shell.cpp https://invent.kde.org/graphics/okular/commit/924a5fb9fcb23a88d3b18bfd3c64f6102a482b88