-
Notifications
You must be signed in to change notification settings - Fork 2k
any_popup_open() remains true even when there are no popups #3657
Description
Describe the bug
If a popup that is being shown is removed without calling Memory::close_popup, egui will think that the popup is still being shown, for example
Memory::any_popup_open() returns true.
Video of the problem:
Screenshot.2024-06-23.at.18.41.41-converted.mp4
You'd think the solution is to always call close_popup() but in some cases that's not practical, for example, the app stops rendering that part of the UI.
Proposed solution: clear Memory::popup at the end of a frame if is_popup_open was not called with the id of the current one (assume the popup was "abandoned"). Probably rename the function to something that reflects this behavior, e.g. retain_popup, check_and_keep_popup_open?
To Reproduce
Steps to reproduce the behavior:
- Open a popup (e.g. color picker, drop-down, etc)
- Without manually closing the popup, stop rendering it (i.e. don't hit that code path at all)
Memory::any_popup_open()istrue
Expected behavior
Memory::any_popup_open() is false
Screenshots
Desktop (please complete the following information):
- Version 0.23.0