diff options
Diffstat (limited to 'scene/gui/menu_bar.cpp')
| -rw-r--r-- | scene/gui/menu_bar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp index b8563f2225..a808a3b1b5 100644 --- a/scene/gui/menu_bar.cpp +++ b/scene/gui/menu_bar.cpp @@ -288,8 +288,8 @@ void MenuBar::_notification(int p_what) { } break; case NOTIFICATION_TRANSLATION_CHANGED: { NativeMenu *nmenu = NativeMenu::get_singleton(); - RID main_menu = nmenu->get_system_menu(NativeMenu::MAIN_MENU_ID); bool is_global = !global_menu_tag.is_empty(); + RID main_menu = is_global ? nmenu->get_system_menu(NativeMenu::MAIN_MENU_ID) : RID(); for (int i = 0; i < menu_cache.size(); i++) { shape(menu_cache.write[i]); if (is_global && menu_cache[i].global_index >= 0) { @@ -492,8 +492,8 @@ void MenuBar::shape(Menu &p_menu) { void MenuBar::_refresh_menu_names() { NativeMenu *nmenu = NativeMenu::get_singleton(); - RID main_menu = nmenu->get_system_menu(NativeMenu::MAIN_MENU_ID); bool is_global = !global_menu_tag.is_empty(); + RID main_menu = is_global ? nmenu->get_system_menu(NativeMenu::MAIN_MENU_ID) : RID(); Vector<PopupMenu *> popups = _get_popups(); for (int i = 0; i < popups.size(); i++) { |
