From c84cf04e95b2b2e3a7bfea52c5f8d4cbaf38bc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 4 Sep 2024 11:35:41 +0200 Subject: [PATCH] PopupMenu: Update margins on visibility change Fixes #96149. Co-authored-by: Haoyu Qiu --- scene/gui/popup_menu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index b91b2407da6..750c41c5b58 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -646,6 +646,8 @@ void PopupMenu::_notification(int p_what) { case NOTIFICATION_POST_POPUP: { initial_button_mask = Input::get_singleton()->get_mouse_button_mask(); during_grabbed_click = (bool)initial_button_mask; + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { // Set margin on the margin container Ref panel_style = get_stylebox("panel"); margin_container->add_constant_override("margin_top", panel_style->get_margin(Margin::MARGIN_TOP));