Skip to content

Commit

Permalink
fix(wayland): stop unwrap of repositioned popup
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Apr 25, 2024
1 parent ab69984 commit 4a90b93
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wayland/xdg_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,16 @@ impl XdgBackend {
panel_item.new_child(uid, self.child_data(uid).unwrap());
}
pub fn reposition_popup(&self, uid: &str, _popup: PopupSurface, positioner: PositionerState) {
self.popups.lock().get_mut(uid).unwrap().1 = positioner;

let mut popups = self.popups.lock();
let Some((_, old_positioner)) = popups.get_mut(uid) else {
return
};
let Some(panel_item) = self.panel_item() else {
return;
};
let geometry = positioner.get_geometry();

*old_positioner = positioner;
panel_item.reposition_child(uid, geometry.into());
}
pub fn drop_popup(&self, uid: &str) {
Expand Down

0 comments on commit 4a90b93

Please sign in to comment.