Bug 465807 - Closing tab sometimes switches to next split
Summary: Closing tab sometimes switches to next split
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 22.12.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 01:58 UTC by Grósz Dániel
Modified: 2023-02-28 13:08 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grósz Dániel 2023-02-16 01:58:47 UTC
SUMMARY
If there are split views, the left (or top) view is focused, and I close a tab in the left(/top) view (either the active tab or another one), in some cases keyboard focus switches to the right(/bottom) side. I'm not sure under exactly what circumstances this happens, but it seems to happen when the file that's in the active tab on the left side the operation (i.e. tab that was switched to if the active tab was closed, or just the already active tab if an inactive tab was closed) happens to also be open on the right side. It doesn't seem to happen in the other direction, i.e. focus switching from the right to the left. Below I describe a series of steps that seem to reproduce the bug reliably. 

STEPS TO REPRODUCE
1. Start Kate with an empty session.
2. Open file A.
3. Click Split Vertical. Now file A is open on both sides, and the right side is focused.
4. Click in the editor on the left side to focus it.
5. Open file B. Now both A and B are open on the left side, with B being the active tab and has keyboard focus; A is open on the right side.
6. Close B by clicking on the X button in the tab.

OBSERVED RESULT
File A remains open on both sides, and the cursor is blinking in the right side view; it has keyboard focus.

EXPECTED RESULT
File A remains open on both sides, and the left side has keyboard focus.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230214
KDE Plasma Version: 5.27.0
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Graphics Platform: tried both X11 and Wayland; it doesn't matter
Comment 1 Grósz Dániel 2023-02-16 02:35:34 UTC
May be related to Bug 465808; this one is about closing a tab in the view with keyboard focus, that one about closing a tab in the other view.
Comment 2 Bug Janitor Service 2023-02-17 10:27:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1110
Comment 3 Waqar Ahmed 2023-02-17 20:53:21 UTC
Git commit c3085d17a3f7aedb5e357fe12b4ad638acdbae20 by Waqar Ahmed.
Committed on 17/02/2023 at 10:29.
Pushed by cullmann into branch 'master'.

Fix closing tab sometimes switches to next split
FIXED-IN: 23.04

M  +29   -0    apps/lib/autotests/kate_view_mgmt_tests.cpp
M  +1    -0    apps/lib/autotests/kate_view_mgmt_tests.h
M  +7    -1    apps/lib/kateviewmanager.cpp

https://invent.kde.org/utilities/kate/commit/c3085d17a3f7aedb5e357fe12b4ad638acdbae20
Comment 4 Waqar Ahmed 2023-02-28 13:08:50 UTC
Git commit 23dee614d7f7360aeb07feaae22e13973c33e2e3 by Waqar Ahmed.
Committed on 28/02/2023 at 12:59.
Pushed by waqar into branch 'release/22.12'.

Fix closing tab sometimes switches to next split
FIXED-IN: 23.04
(cherry picked from commit c3085d17a3f7aedb5e357fe12b4ad638acdbae20)

M  +29   -0    apps/lib/autotests/kate_view_mgmt_tests.cpp
M  +1    -0    apps/lib/autotests/kate_view_mgmt_tests.h
M  +7    -1    apps/lib/kateviewmanager.cpp

https://invent.kde.org/utilities/kate/commit/23dee614d7f7360aeb07feaae22e13973c33e2e3