diff --git a/docs/changelog.rst b/docs/changelog.rst index 89ea5c846..cea639189 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -168,6 +168,10 @@ Detailed list of changes :code:`--base-dir` into account, and file name completion is relative to that directory (:pull:`10851`, :pull:`10852`, :disc:`10867`) +- Graphics protocol: Fix a newly displayed image sometimes not being rendered + until something else, such as mouse movement, causes the window to be redrawn + (:iss:`10875`) + - Fix the scrolled back view jumping, and images, the cursor and the scrollbar getting out of sync with the text, when new output arrives (:pull:`10841`, :pull:`10847`) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index e1d60e614..e4d82b52f 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -946,7 +946,6 @@ prepare_to_render_os_window( Window *w = tab->windows + i; #define WD w->render_data if (w->visible && WD.screen) { - os_window->needs_layers = os_window->needs_layers || screen_needs_rendering_in_layers(os_window, w, WD.screen); screen_check_pause_rendering(WD.screen, now); *num_visible_windows += 1; color_type window_bg = @@ -1037,6 +1036,10 @@ prepare_to_render_os_window( } } if (send_cell_data_to_gpu(WD.vao_idx, WD.screen, os_window)) needs_render = true; + // Must be after send_cell_data_to_gpu() as that updates the graphics layers, which + // determine whether there are images that need rendering in layers. Otherwise, a newly + // placed image is not drawn until something else causes a re-render, see #10875 + os_window->needs_layers = os_window->needs_layers || screen_needs_rendering_in_layers(os_window, w, WD.screen); if (WD.screen->start_visual_bell_at | WD.screen->start_drag_overlay_at) needs_render = true; if (OPT(progress_bar) != PROGRESS_BAR_HIDDEN && WD.screen->progress_state == PROGRESS_STATE_INDETERMINATE) needs_render = true; // Prepare window title bar screen data for GPU