From f019d03a2fba8da973689ab6fcfb166c5ea662e0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 11 Aug 2026 11:46:21 +0300 Subject: [PATCH] X11: fix menu windows being taller than the screen Menu windows with lots of entries (such as #optionsfull) were taller than the screen, making them awkward to use. The widget needs to be realized before we can get the size. Also, we need to set the size of the parent popup, not the acting widget. --- doc/fixes5-0-1.txt | 1 + win/X11/winmenu.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/fixes5-0-1.txt b/doc/fixes5-0-1.txt index 5393f619a..17fb06f49 100644 --- a/doc/fixes5-0-1.txt +++ b/doc/fixes5-0-1.txt @@ -244,6 +244,7 @@ Windows: in the event that there is a collision between a menu group X11: obey timed_delay X11: improve TTY-style status line with text attributes for status hilites, hitpointbar, some unicode support, 3-line status +X11: fix menu windows being taller than the screen General New Features diff --git a/win/X11/winmenu.c b/win/X11/winmenu.c index 1c6885648..4e2210966 100644 --- a/win/X11/winmenu.c +++ b/win/X11/winmenu.c @@ -1062,6 +1062,7 @@ X11_select_menu(winid window, int how, menu_item **menu_list) menu_create_entries(wp, &menu_info->curr_menu); /* if viewport will be bigger than the screen, limit its height */ + XtRealizeWidget(wp->popup); /* need to realize before we get size/pos */ num_args = 0; XtSetArg(args[num_args], XtNwidth, &v_pixel_width); num_args++; XtSetArg(args[num_args], XtNheight, &v_pixel_height); num_args++; @@ -1076,9 +1077,8 @@ X11_select_menu(winid window, int how, menu_item **menu_list) num_args = 0; XtSetArg(args[num_args], XtNwidth, v_pixel_width); num_args++; XtSetArg(args[num_args], XtNheight, v_pixel_height); num_args++; - XtSetValues(wp->w, args, num_args); + XtSetValues(wp->popup, args, num_args); } - XtRealizeWidget(wp->popup); /* need to realize before we position */ /* if menu is not up, position it */ if (!menu_info->is_up) {