From 4a81c87a7ccd8edd659eb4167a1f47ee6c745438 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 13 Mar 2026 15:57:05 +0200 Subject: [PATCH] Avoid assertion violations in 'display_menu_bar' * src/xdisp.c (display_menu_bar): Return immediately if the menu-bar items were not yet computed. This avoids assertion violations when this function is called as part of creating a new frame. (Bug#80603) --- src/xdisp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index d73fc331733..8af54ad49f1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -27561,6 +27561,10 @@ display_menu_bar (struct window *w) return; #endif /* HAVE_HAIKU */ + /* Don't do all this if the frame's menu bar is not yet set. */ + if (NILP (FRAME_MENU_BAR_ITEMS (f))) + return; + #if defined (USE_X_TOOLKIT) || defined (USE_GTK) eassert (!FRAME_WINDOW_P (f)); init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID);