From 392142d3222327cc5165d3acfb5398775b371955 Mon Sep 17 00:00:00 2001 From: Ray Chason Date: Tue, 18 Aug 2026 09:47:29 -0400 Subject: [PATCH] For menu items, set up pixmap and then manage The widget is created with a label but not a pixmap, and then a pixmap is set up for display. If the label is already realized and managed, it will not resize when the pixmap is set up. This causes problems when the inventory window is updated: unlike other menus, the parent Form widget is already realized. The fix is to create the item widget in an unmanaged state (XtCreateWidget), set up the pixmap (X11_wrap_widget and X11_set_attrs), and then manage it (XtManageChild). --- win/X11/winmenu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 0addf7c39..4604b78a0 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1366,13 +1366,17 @@ menu_create_entries(struct xwindow *wp, struct menu *curr_menu) menulineidx++; Sprintf(tmpbuf, "menuline_%s", (canpick) ? "command" : "label"); - curr->w = linewidget = XtCreateManagedWidget(tmpbuf, - canpick - ? commandWidgetClass - : labelWidgetClass, - wp->w, args, num_args); + /* Need to create the widget unmanaged, set up the pixmap, and then + manage it, or else items in the inventory window get the wrong + size */ + curr->w = linewidget = XtCreateWidget(tmpbuf, + canpick + ? commandWidgetClass + : labelWidgetClass, + wp->w, args, num_args); X11_wrap_widget(curr->w, NHW_MENU); X11_set_attrs(curr->w, 0x1 << attr); + XtManageChild(curr->w); if (canpick) XtAddCallback(linewidget, XtNcallback, menu_select,