Closed
Description
Godot version
reproduced on 4.0.3-stable, 4.1-stable, and master
System information
Mac m1 - MacOs Ventura 13.2
Issue description
When you create a MenuBar and set prefer_global_menu
to true, if adds the menues to the native topbar. However when user clicks on the menu to expand it, the about_to_popup signal is not being emmited for such menu.
This is an issue because i use that signal to enable/disable items according to the state of the project, without this i would require to update it for every single action that is made in the project that could clange the state of a menu.
Steps to reproduce
- Create a MenuBar node
- Add a PopupMenu child to it
- Add 3 items to the popup menu
- make a script like this:
var _currently_active_item = 0
func _ready():
$PopupMenu.about_to_popup.connect(_on_popup_menu_about_to_popup)
func _on_popup_menu_about_to_popup():
_currently_active_item += 1
_currently_active_item %= $PopupMenu.item_count
for i in range($PopupMenu.item_count):
$PopupMenu.set_item_disabled(i, i != _currently_active_item)