Fix a regression that caused closing an overlay window to focus the previously focused window rather than the underlying window

Fixes #1720
This commit is contained in:
Kovid Goyal 2019-06-17 09:00:47 +05:30
parent 38bc90f724
commit 603533e632
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- unicode_input kitten: Fix a regression that broke using indices to select - unicode_input kitten: Fix a regression that broke using indices to select
recently used symbols. recently used symbols.
- Fix a regression that caused closing an overlay window to focus
the previously focused window rather than the underlying window (:iss:`1720`)
0.14.2 [2019-06-09] 0.14.2 [2019-06-09]
--------------------- ---------------------

View File

@ -268,6 +268,12 @@ class Tab: # {{{
next_window_id = self.windows[idx].id next_window_id = self.windows[idx].id
active_window_idx = self.current_layout.remove_window(self.windows, window, self.active_window_idx) active_window_idx = self.current_layout.remove_window(self.windows, window, self.active_window_idx)
remove_window(self.os_window_id, self.id, window.id) remove_window(self.os_window_id, self.id, window.id)
if window.overlay_for is not None:
for idx, q in enumerate(self.windows):
if q.id == window.overlay_for:
active_window_idx = idx
next_window_id = q.id
break
if next_window_id is None and active_window_idx is not None and len(self.windows) > active_window_idx: if next_window_id is None and active_window_idx is not None and len(self.windows) > active_window_idx:
next_window_id = self.windows[active_window_idx].id next_window_id = self.windows[active_window_idx].id
if next_window_id is not None: if next_window_id is not None: