]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0641: GTK4: crash in gui_mch_menu_hidden() v9.2.0641
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Sun, 14 Jun 2026 14:44:48 +0000 (14:44 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 14 Jun 2026 14:44:48 +0000 (14:44 +0000)
Problem:  GTK4: crash in gui_mch_menu_hidden()
Solution: Skip the sentinel like gui_mch_menu_grey() does
          (Yasuhiro Matsumoto).

Menu items use the (GtkWidget *)1 sentinel as their id, but
gui_mch_menu_hidden() only skipped NULL ids and passed the sentinel
to gtk_widget_get_visible(), causing a SEGV.

closes: #20523

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

index 77ac056366a94378ee3f29ce64cfac0bc058e703..b3135a0ab8e889acaddb20104e00b1fbac5698f3 100644 (file)
@@ -2685,7 +2685,9 @@ gui_mch_menu_grey(vimmenu_T *menu, int grey)
     void
 gui_mch_menu_hidden(vimmenu_T *menu, int hidden)
 {
-    if (menu->id == 0)
+    // GMenu-based menu items have no real widget, only the (GtkWidget *)1
+    // marker; they cannot be toggled via the widget API.
+    if (menu->id == NULL || menu->id == (GtkWidget *)1)
        return;
 
     if (hidden)
index 2e42bb357696ee0f466eee3df38585ec7781bf48..83d1e805840881f3679a24f11b6bf6009cf4072c 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    641,
 /**/
     640,
 /**/