mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-17 05:32:41 +00:00
Fix on_quit watchers being called repeatedly when they abort an OS quit request
When an on_quit watcher aborted a quit, the application quit request was left as CONFIRMABLE_CLOSE_REQUESTED, so process_pending_closes() called boss.quit() on every tick.
This commit is contained in:
parent
10b3792dfb
commit
92e2fc477c
2 changed files with 5 additions and 0 deletions
|
|
@ -231,6 +231,9 @@ Detailed list of changes
|
|||
0.50.0 [future]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Fix kitty repeatedly calling ``on_quit`` watchers when a watcher aborts a quit
|
||||
requested by the OS, for example, via the macOS menu or Dock
|
||||
|
||||
- Graphics protocol: Add two new :ref:`indexed color image formats
|
||||
<indexed_color_data>` whose pixels are indices into the terminal color
|
||||
palette, so that images automatically change color along with the terminal
|
||||
|
|
|
|||
|
|
@ -2484,6 +2484,7 @@ class Boss:
|
|||
needs_confirmation = x != 0 and num >= abs(x)
|
||||
if not needs_confirmation:
|
||||
if not self._call_on_quit_watchers({'confirmed': True}):
|
||||
set_application_quit_request(NO_CLOSE_REQUESTED)
|
||||
return
|
||||
set_application_quit_request(IMPERATIVE_CLOSE_REQUESTED)
|
||||
return
|
||||
|
|
@ -2500,6 +2501,7 @@ class Boss:
|
|||
return
|
||||
return
|
||||
if not self._call_on_quit_watchers({'confirmed': False}):
|
||||
set_application_quit_request(NO_CLOSE_REQUESTED)
|
||||
return
|
||||
msg = msg or _('It has {} windows.').format(num)
|
||||
w = self.confirm(_('Are you sure you want to quit kitty?') + ' ' + msg, self.handle_quit_confirmation, window=active_window, title=_('Quit kitty?'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue