fix(menu-bar): exit early from popup creation if no root is hovered

This commit is contained in:
Ashley Wulber 2025-06-10 16:55:30 -04:00 committed by Ashley Wulber
parent 92ec78ba29
commit 7f2d34ead4
2 changed files with 6 additions and 5 deletions

2
iced

@ -1 +1 @@
Subproject commit 717bc5dbfbc8f78e367e08e76a9572ee0ebc1f32
Subproject commit fc9d49eb2f830fe394252ff6799d59ad828243bc

View file

@ -375,13 +375,14 @@ where
let hovered_root = layout
.children()
.position(|lo| view_cursor.is_over(lo.bounds()));
if old_active_root
.zip(hovered_root)
.is_some_and(|r| r.0 == r.1)
if hovered_root.is_none()
|| old_active_root
.zip(hovered_root)
.is_some_and(|r| r.0 == r.1)
{
return;
}
let (id, root_list) = my_state.inner.with_data_mut(|state| {
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
// close existing popups