mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-20 07:02:28 +00:00
Fix focus changing when closing non focused window before the focused one
This commit is contained in:
parent
cbc5382bbe
commit
b4d43249b0
3 changed files with 8 additions and 2 deletions
|
|
@ -206,6 +206,9 @@ Detailed list of changes
|
|||
status bars, file trees, etc. Create them with :code:`launch --type=window-dock`
|
||||
or :code:`launch --type=tab-dock`, see :ref:`docks`
|
||||
|
||||
- Fix closing an unfocused window that comes before the focused window in the
|
||||
layout sometimes moving focus to a different window
|
||||
|
||||
0.49.2 [2026-10-01]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
|
|
@ -656,7 +656,8 @@ class WindowList:
|
|||
self._active_group_idx = self._most_recent_main_group_idx()
|
||||
else:
|
||||
self.make_previous_group_active(notify=False)
|
||||
elif self.active_group_idx >= len(self.groups):
|
||||
elif self.active_group_idx > i:
|
||||
# The active group shifted down by one
|
||||
self._active_group_idx -= 1
|
||||
if (dock := self.active_dock) is not None and (owner := self.dock_owner(dock)) is not None:
|
||||
# The active normal group must remain the owner of the active dock
|
||||
|
|
|
|||
|
|
@ -186,8 +186,10 @@ class TestLayout(BaseTest):
|
|||
windows.set_active_group_idx(0)
|
||||
to_remove = windows.active_window
|
||||
windows.set_active_group_idx(3)
|
||||
prev_window = windows.active_window
|
||||
windows.remove_window(to_remove)
|
||||
self.ae(windows.active_group_idx, 3)
|
||||
self.ae(windows.active_group_idx, 2)
|
||||
self.ae(windows.active_window, prev_window)
|
||||
check_visible()
|
||||
expect_ids(2, 3, 5, 6)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue