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>
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)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 641,
/**/
640,
/**/