mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 05:54:59 +02:00
Emits an IME lost focus event when the window lost focus or closed
This commit is contained in:
@@ -689,6 +689,9 @@ class Window:
|
||||
tab = self.tabref()
|
||||
if tab is not None:
|
||||
tab.relayout_borders()
|
||||
else:
|
||||
# Cancel IME composition after loses focus
|
||||
update_ime_position_for_window(self.id, True, True)
|
||||
|
||||
def title_changed(self, new_title: Optional[str]) -> None:
|
||||
self.child_title = sanitize_title(new_title or self.default_title)
|
||||
@@ -1021,6 +1024,8 @@ class Window:
|
||||
self.call_watchers(self.watchers.on_close, {})
|
||||
self.destroyed = True
|
||||
if hasattr(self, 'screen'):
|
||||
# Cancel IME composition when window is destroyed
|
||||
update_ime_position_for_window(self.id, True, True)
|
||||
# Remove cycles so that screen is de-allocated immediately
|
||||
self.screen.reset_callbacks()
|
||||
del self.screen
|
||||
|
||||
Reference in New Issue
Block a user