From c397fc4301fb352b037bf090a3e1e8f598492e5b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 11 Oct 2025 10:12:45 +0530 Subject: [PATCH] Fix continuous redraw when disable_ligatures set to cursor and tab bar visible Fixes #9071 --- docs/changelog.rst | 2 ++ kitty/child-monitor.c | 5 ++++- kitty/shaders.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index b1e35e553..2fd7861f0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -162,6 +162,8 @@ Detailed list of changes - Graphics: Fix animated images sometimes not auto playing or auto playing at the wrong start frame if the same image id is used for a subsequent image +- Fix a regression in 0.43.0 that caused high CPU usage when :opt:`disable_ligatures` was set to ``cursor`` and the tab bar was visible (:iss:`9071`) + 0.43.1 [2025-10-01] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index aaefc50ff..e8ef17715 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -725,6 +725,9 @@ prepare_to_render_os_window(OSWindow *os_window, monotonic_t now, unsigned int * call_boss(update_tab_bar_data, "K", os_window->id); os_window->tab_bar_data_updated = true; } + // we never render a cursor in the tab bar + CursorRenderInfo *cri = &TD.screen->cursor_render_info; + zero_at_ptr(cri); cri->x = TD.screen->cursor->x; cri->y = TD.screen->cursor->y; if (send_cell_data_to_gpu(TD.vao_idx, TD.screen, os_window)) needs_render = true; os_window->needs_layers = os_window->needs_layers || screen_needs_rendering_in_layers(os_window, NULL, TD.screen); } @@ -888,7 +891,7 @@ render_os_window(OSWindow *w, monotonic_t now, bool scan_for_animated_images) { static void render(monotonic_t now, bool input_read) { - EVDBG("input_read: %d, check_for_active_animated_images: %d", input_read, global_state.check_for_active_animated_images); + EVDBG("input_read: %d, check_for_active_animated_images: %d\n", input_read, global_state.check_for_active_animated_images); static monotonic_t last_render_at = MONOTONIC_T_MIN; monotonic_t time_since_last_render = last_render_at == MONOTONIC_T_MIN ? OPT(repaint_delay) : now - last_render_at; if (!input_read && time_since_last_render < OPT(repaint_delay)) { diff --git a/kitty/shaders.c b/kitty/shaders.c index 85826ac11..ba6fc4664 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -436,7 +436,7 @@ has_bgimage(OSWindow *w) { } static color_type -cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, CursorRenderInfo *cursor, OSWindow *os_window, float inactive_text_alpha, float bg_alpha) { +cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, const CursorRenderInfo *cursor, OSWindow *os_window, float inactive_text_alpha, float bg_alpha) { struct GPUCellRenderData { GLfloat use_cell_bg_for_selection_fg, use_cell_fg_for_selection_color, use_cell_for_selection_bg;