From 7c237dcb024f12db976147b48dc621f0c93a3f5e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Oct 2025 22:28:31 +0530 Subject: [PATCH] macOS: Fix progress bar on dock icon doubling speed with every indeterminate progress state without an intervening clear Fixes #9114 --- docs/changelog.rst | 2 ++ kitty/cocoa_window.m | 6 ++++-- kitty/window.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 34528dd00..9e331a2af 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -166,6 +166,8 @@ Detailed list of changes - macOS: Handle dropping of file promises into kitty in addition to file paths (:pull:`9084`) +- macOS: Fix indeterminate progress bar displayed on dock icon increasing speed when indeterminate progress is set without being cleared first (:iss:`9114`) + 0.43.1 [2025-10-01] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/cocoa_window.m b/kitty/cocoa_window.m index e41a84787..365a62c43 100644 --- a/kitty/cocoa_window.m +++ b/kitty/cocoa_window.m @@ -1315,8 +1315,10 @@ cocoa_show_progress_bar_on_dock_icon(PyObject *self UNUSED, PyObject *args) { [dock_pbar setFraction:percent/100.]; [dock_pbar setIndeterminate:NO]; } else if (percent > 100) { - [dock_pbar setIndeterminate:YES]; - tick_dock_pbar(); + if (![dock_pbar isIndeterminate]) { + [dock_pbar setIndeterminate:YES]; + tick_dock_pbar(); + } } [dock_pbar setFrameSize:NSMakeSize(dockTile.size.width - 20, 20)]; [dock_pbar setFrameOrigin:NSMakePoint(10, -2)]; diff --git a/kitty/window.py b/kitty/window.py index 0687bbfbc..bf21b87c0 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -691,10 +691,10 @@ class Window: self.last_focused_at = 0. self.is_focused: bool = False self.progress = Progress() + self.clear_progress_timer: int = 0 self.last_resized_at = 0. self.started_at = monotonic() self.created_at = time_ns() - self.clear_progress_timer: int = 0 self.current_remote_data: list[str] = [] self.current_mouse_event_button = 0 self.current_clipboard_read_ask: bool | None = None