fix(menu-bar): exit early from popup creation if no root is hovered
This commit is contained in:
parent
92ec78ba29
commit
7f2d34ead4
2 changed files with 6 additions and 5 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 717bc5dbfbc8f78e367e08e76a9572ee0ebc1f32
|
Subproject commit fc9d49eb2f830fe394252ff6799d59ad828243bc
|
||||||
|
|
@ -375,13 +375,14 @@ where
|
||||||
let hovered_root = layout
|
let hovered_root = layout
|
||||||
.children()
|
.children()
|
||||||
.position(|lo| view_cursor.is_over(lo.bounds()));
|
.position(|lo| view_cursor.is_over(lo.bounds()));
|
||||||
|
if hovered_root.is_none()
|
||||||
if old_active_root
|
|| old_active_root
|
||||||
.zip(hovered_root)
|
.zip(hovered_root)
|
||||||
.is_some_and(|r| r.0 == r.1)
|
.is_some_and(|r| r.0 == r.1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let (id, root_list) = my_state.inner.with_data_mut(|state| {
|
let (id, root_list) = my_state.inner.with_data_mut(|state| {
|
||||||
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
|
if let Some(id) = state.popup_id.get(&self.window_id).copied() {
|
||||||
// close existing popups
|
// close existing popups
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue