From dc77009e5549f9770eabacb713e9492dd2614e0d Mon Sep 17 00:00:00 2001 From: Andrew Hlynskyi Date: Wed, 20 May 2020 11:51:40 +0300 Subject: [PATCH] Fixed confirm_os_window_close bug introduced in commit 7bf83603c8ad6a8837d8d03f1d6063d7733e25a2 --- docs/changelog.rst | 2 +- kitty/boss.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 481c33d6d..d056879b7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,7 +12,7 @@ To update |kitty|, :doc:`follow the instructions `. - Tall and Fat layouts: Add a ``mirrored`` option to put the full size window on the opposite edge of the screen (:iss:`2654`) -- Add an option :opt:`confirm_on_os_window_close` to ask for confirmation +- Add an option :opt:`confirm_os_window_close` to ask for confirmation when closing an OS window with multiple kitty windows. - Add a new mappable ``quit`` action to quit kitty completely. diff --git a/kitty/boss.py b/kitty/boss.py index 65e1ba13d..24b40b7d8 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -732,7 +732,7 @@ class Boss: def confirm_os_window_close(self, os_window_id: int) -> None: tm = self.os_window_map.get(os_window_id) - if tm is None or self.opts.confirm_os_window_close <= tm.number_of_windows: + if tm is None or self.opts.confirm_os_window_close > tm.number_of_windows: mark_os_window_for_close(os_window_id) return if tm is not None: @@ -768,7 +768,7 @@ class Boss: num = 0 for q in self.os_window_map.values(): num += q.number_of_windows - if self.opts.confirm_os_window_close <= num or tm is None: + if self.opts.confirm_os_window_close > num or tm is None: set_application_quit_request(IMPERATIVE_CLOSE_REQUESTED) return if current_application_quit_request() == CLOSE_BEING_CONFIRMED: