Commit: patch 9.2.0641: GTK4: crash in gui_mch_menu_hidden()

0 views
Skip to first unread message

Christian Brabandt

unread,
11:00 AM (2 hours ago) 11:00 AM
to vim...@googlegroups.com
patch 9.2.0641: GTK4: crash in gui_mch_menu_hidden()

Commit: https://github.com/vim/vim/commit/fb3208a5f6d143bd02b7aa34ddc44701b7b5eb0a
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Sun Jun 14 14:44:48 2026 +0000

patch 9.2.0641: GTK4: crash in gui_mch_menu_hidden()

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 <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c
index 77ac05636..b3135a0ab 100644
--- a/src/gui_gtk4.c
+++ b/src/gui_gtk4.c
@@ -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)
diff --git a/src/version.c b/src/version.c
index 2e42bb357..83d1e8058 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 641,
/**/
640,
/**/
Reply all
Reply to author
Forward
0 new messages