fix: nested popup destruction

This commit is contained in:
Ashley Wulber 2025-06-10 10:36:50 -04:00
parent 78153e6240
commit 9668aeba1f
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 24 additions and 17 deletions

View file

@ -65,13 +65,14 @@ impl PopupHandler for SctkState {
break;
}
state::PopupParent::Popup(popup_to_destroy_first) => {
let popup_to_destroy_first = self
.popups
.iter()
.position(|p| {
let Some(popup_to_destroy_first) =
self.popups.iter().position(|p| {
p.popup.wl_surface() == &popup_to_destroy_first
})
.unwrap();
else {
log::warn!("could not find popup to destroy first.");
return;
};
let popup_to_destroy_first =
self.popups.remove(popup_to_destroy_first);
to_destroy.push(popup_to_destroy_first);