Index: uspace/lib/ui/src/menuentry.c
===================================================================
--- uspace/lib/ui/src/menuentry.c	(revision 28ca31edbe1636231b006df50ab0d40aec06f59d)
+++ uspace/lib/ui/src/menuentry.c	(revision ee3b28a97324351b0acfb1161a2ed94632eab95c)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2023 Jiri Svoboda
+ * Copyright (c) 2024 Jiri Svoboda
  * All rights reserved.
  *
@@ -145,5 +145,20 @@
 		return;
 
+	mentry->menu->total_h -= ui_menu_entry_height(mentry);
+	/* NOTE: max_caption_w/max_shortcut_w not updated (speed) */
+
 	list_remove(&mentry->lentries);
+
+	/*
+	 * If we emptied the menu, reset accumulated dims so they
+	 * can be correctly calculated when (if) the menu is
+	 * re-populated.
+	 */
+	if (list_empty(&mentry->menu->entries)) {
+		mentry->menu->total_h = 0;
+		mentry->menu->max_caption_w = 0;
+		mentry->menu->max_shortcut_w = 0;
+	}
+
 	free(mentry->caption);
 	free(mentry);
