Skip to content

Commit

Permalink
[macOS] Do not unbind PopupMenu from global menu on clear call.
Browse files Browse the repository at this point in the history
  • Loading branch information
bruvzg committed Jan 16, 2024
1 parent 4b55c81 commit 5a61fec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scene/gui/popup_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,8 @@ void PopupMenu::clear(bool p_free_submenus) {
}

if (!global_menu_name.is_empty()) {
for (int i = 0; i < items.size(); i++) {
DisplayServer *ds = DisplayServer::get_singleton();
for (int i = items.size() - 1; i >= 0; i--) {
Item &item = items.write[i];
if (!item.submenu.is_empty()) {
PopupMenu *pm = Object::cast_to<PopupMenu>(get_node_or_null(item.submenu));
Expand All @@ -2433,8 +2434,8 @@ void PopupMenu::clear(bool p_free_submenus) {
}
item.submenu_bound = false;
}
ds->global_menu_remove_item(global_menu_name, i);
}
DisplayServer::get_singleton()->global_menu_clear(global_menu_name);
}
items.clear();

Expand Down

0 comments on commit 5a61fec

Please sign in to comment.