From 10ee838c3b4768f9d1c98ba0e1c9712eb0b30ea1 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Thu, 14 Nov 2024 08:14:11 +0900 Subject: [PATCH] menu: fix menus disappearing when opening pipemenu Commit 7651531 introduced a regression: `menu_update_scene()` which re-creates a menu scene was called for all the menus when a pipemenu is created, so the menus (parent of the pipemenu) were always moved to (0,0) and hidden, and the pipemenu was incorrectly positioned. This commit fixes it by calling `menu_update_scene()` only for the pipemenu when it's created. --- src/menu/menu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/menu/menu.c b/src/menu/menu.c index 966601eb..0056b719 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -322,6 +322,7 @@ title_create_scene(struct menuitem *menuitem, int *item_y) *item_y += theme->menu_header_height; } +/* (Re)creates the scene of the menu */ static void menu_update_scene(struct menu *menu) { @@ -370,9 +371,16 @@ menu_update_scene(struct menu *menu) static void post_processing(struct server *server) { + /* + * Create menu scene after all of its contents is determined + * (e.g. when finished reading menu.xml or received output from + * pipemenu program). + */ struct menu *menu; wl_list_for_each(menu, &server->menus, link) { - menu_update_scene(menu); + if (!menu->scene_tree) { + menu_update_scene(menu); + } } }