]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0652: popup: stale kitty image after clipwindow scrolls out of view v9.2.0652
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Mon, 15 Jun 2026 18:54:08 +0000 (18:54 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 15 Jun 2026 18:54:08 +0000 (18:54 +0000)
Problem:  a clipwindow popup containing an image leaves a stale image on
          the terminal after it scrolls out of view, with the kitty
          graphics protocol.
Solution: Delete the kitty placement and the GTK4 image and force a
          redraw before hiding, mirroring the textprop scroll-out path
          (Yasuhiro Matsumoto).

closes: #20525

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/popupwin.c
src/version.c

index dfd880a8267f798d050cde0c07463617faed47e6..02ecffbfd9b4bfb8e965612d6c467360f8e72f0a 100644 (file)
@@ -2930,6 +2930,25 @@ popup_adjust_position(win_T *wp)
     // leaving stray decorations behind.
     if (popup_compute_clipwindow_offsets(wp))
     {
+       if ((wp->w_popup_flags & POPF_HIDDEN) == 0)
+       {
+#ifdef FEAT_IMAGE_KITTY
+           // delete the kitty placement before hiding, like popup_hide()
+           popup_image_clear_kitty(wp);
+#endif
+#ifdef FEAT_IMAGE_GDK
+           if (gui.in_use)
+               gui_gtk4_remove_image(wp);
+#endif
+#ifdef FEAT_IMAGE
+           if (wp->w_popup_image_data != NULL)
+           {
+               redraw_all_later(UPD_NOT_VALID);
+               status_redraw_all();
+               popup_mask_refresh = TRUE;
+           }
+#endif
+       }
        popup_hide_for_textprop(wp);
        return;
     }
index 04b04e6b569efabf29d8059bc9c86ca1eba5e938..7de996977fde121815a2689fa7a8127ac79e83ac 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    652,
 /**/
     651,
 /**/