Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopupMenu with prefer_native_menu=true does not emit popup_hide signal on Windows #100978

Closed
marcelovbcfilho opened this issue Dec 31, 2024 · 1 comment · Fixed by #100987
Closed

Comments

@marcelovbcfilho
Copy link
Contributor

marcelovbcfilho commented Dec 31, 2024

Tested versions

v4.3.stable.mono.official [77dcf97]

System information

Godot v4.3.stable.mono - Windows 10.0.26100 - Vulkan (Forward+) - dedicated AMD Radeon RX 6800M (Advanced Micro Devices, Inc.; 32.0.12033.1030) - AMD Ryzen 9 5980HX with Radeon Graphics (16 Threads)

Issue description

  • When using PopUpMenu to create a right click context menu with prefer_native_menu set to true the popup_hide signal is not emitted.
  • On MacOS with prefer_native_menu set to true the popup_hide signal is emitted as expected.
  • Also when prefer_native_menu is set to false the popup_hide signal is emitted as expected.

Steps to reproduce

  • Create empty project
  • Add some Buttons
  • Add a PopUpMenu with prefer_native_menu=true
  • Add a script that when right click on button calls the PopUpMenu popup() mthod
  • In the same script connect the popup_hide signal to a function
  • Dismiss the PopUpMenu by clicking somewhere else
  • Signal should be emitted

Minimal reproduction project (MRP)

bug-popup-menu.zip

I also recorded a video to better explain the issue.
https://github.com/user-attachments/assets/db3bec37-dbdf-4edb-ba74-f96efda158bb

@AThousandShips AThousandShips changed the title PopUpMenu with prefer_native_menu=true does not emit popup_hide signal on Windows PopupMenu with prefer_native_menu=true does not emit popup_hide signal on Windows Dec 31, 2024
@marcelovbcfilho
Copy link
Contributor Author

Searched around the source code and this maybe isn't a bug, but a missing feature, the set_popup_close_callback method that is used to emit the popup_hide signal is marked as not supported in the windows specific implementation.

void NativeMenuWindows::set_popup_close_callback(const RID &p_rid, const Callable &p_callback) {
// Not supported.
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants