Speed up taking over of tab

This commit is contained in:
Kovid Goyal 2019-11-12 10:38:57 +05:30
parent 5dc14c5861
commit 86eed7f895
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -83,16 +83,17 @@ class Tab: # {{{
orig_windows = deque(other_tab.windows) orig_windows = deque(other_tab.windows)
orig_history = deque(other_tab.active_window_history) orig_history = deque(other_tab.active_window_history)
orig_active = other_tab._active_window_idx orig_active = other_tab._active_window_idx
while other_tab.windows: for window in other_tab.windows:
underlaid_window, overlaid_window = other_tab.detach_window(other_tab.windows[0]) detach_window(other_tab.os_window_id, other_tab.id, window.id)
if underlaid_window: other_tab.windows = deque()
self.attach_window(underlaid_window) other_tab._active_window_idx = 0
if overlaid_window:
self.attach_window(overlaid_window)
self.active_window_history = orig_history self.active_window_history = orig_history
self.windows = orig_windows self.windows = orig_windows
self._active_window_idx = orig_active self._active_window_idx = orig_active
for window in self.windows:
window.change_tab(self)
attach_window(self.os_window_id, self.id, window.id)
self.relayout()
def _set_current_layout(self, layout_name): def _set_current_layout(self, layout_name):
self._last_used_layout = self._current_layout_name self._last_used_layout = self._current_layout_name