From baf8976c2dd265cd591eaaa7b57f91eb89c2bdeb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 29 Sep 2021 14:39:48 +0530 Subject: [PATCH] Keep global_watchers immutable --- kitty/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index f12e60eba..ebba21c8c 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -130,7 +130,7 @@ class Watchers: ans = Watchers() ans.on_close = self.on_close[:] ans.on_resize = self.on_resize[:] - ans.on_focus_change = self.on_focus_change + ans.on_focus_change = self.on_focus_change[:] return ans @property @@ -356,7 +356,7 @@ class Window: self.watchers = watchers self.watchers.add(global_watchers()) else: - self.watchers = global_watchers() + self.watchers = global_watchers().copy() self.current_mouse_event_button = 0 self.current_clipboard_read_ask: Optional[bool] = None self.prev_osc99_cmd = NotificationCommand()