egui/crates
Juan Campa 77244cd4c5
⚠️ Close popup if `Memory::keep_popup_open` isn't called (#5814)
Breaking changes:
- When using the Memory::popup state, it's now required to call
keep_popup_open each frame or the popup will close.
- Usually handled by the `Popup` struct, but required for custom popups
using the state in `Memory` directly

-----

If a popup is abandoned `Memory::popup` would remain `Some`. This is
problematic if, for example, you have logic that checks
`is_any_popup_open`.

This PR adds a new requirement for popups keeping their open state in
`Memory::popup`. They must call `Memory::keep_popup_open` as long as
they are being rendered. The recent changes in #5716 make this easy to
implement.

Supersedes #4697 which had an awkward implementation

These two videos show a case where a context menu was open when the
underlying widget got removed.

Before (`any_popup_open` remains `true`)
![Screenshot 2025-03-16 at 18 22
50](https://github.com/user-attachments/assets/22db64dd-e6f2-4501-9bda-39f470b9210c)

After
![Screenshot 2025-03-16 at 18 21
14](https://github.com/user-attachments/assets/bd4631b1-a0ad-4047-a14d-cd4999710e07)



* Closes https://github.com/emilk/egui/issues/3657
* [x] I have followed the instructions in the PR template
2025-03-20 10:51:42 +01:00
..
ecolor Add color picker menu item example (#5755) 2025-03-19 09:33:17 +01:00
eframe Add `OutputCommand::SetPointerPosition` to set mouse position (#5776) 2025-03-20 10:51:02 +01:00
egui ⚠️ Close popup if `Memory::keep_popup_open` isn't called (#5814) 2025-03-20 10:51:42 +01:00
egui-wgpu Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui-winit Add `OutputCommand::SetPointerPosition` to set mouse position (#5776) 2025-03-20 10:51:02 +01:00
egui_demo_app Add `Ui::close` and `Response::should_close` (#5729) 2025-02-20 17:59:29 +01:00
egui_demo_lib Add `OutputCommand::SetPointerPosition` to set mouse position (#5776) 2025-03-20 10:51:02 +01:00
egui_extras refactor mime type support detection in image loader to allow for deferred handling and appended encoding info (#5686) 2025-03-18 11:51:00 +01:00
egui_glow Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00
egui_kittest Fix disabled `DragValue` eating focus, causing focus to reset (#5826) 2025-03-20 10:45:16 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
epaint Simplify the text cursor API (#5785) 2025-03-20 10:49:38 +01:00
epaint_default_fonts Release 0.31.1 - text_edit and kittest fixes 2025-03-05 08:37:34 +01:00