Disable pointer grab with dead starting surface

This commit is contained in:
Victor Berger 2021-06-29 22:27:38 +02:00 committed by Victor Berger
parent 736eb11cd5
commit 47bc37c67b
1 changed files with 8 additions and 0 deletions

View File

@ -125,6 +125,14 @@ impl PointerInternal {
match grab { match grab {
GrabStatus::Borrowed => panic!("Accessed a pointer grab from within a pointer grab access."), GrabStatus::Borrowed => panic!("Accessed a pointer grab from within a pointer grab access."),
GrabStatus::Active(_, ref mut handler) => { GrabStatus::Active(_, ref mut handler) => {
// If this grab is associated with a surface that is no longer alive, discard it
if let Some((ref surface, _)) = handler.start_data().focus {
if !surface.as_ref().is_alive() {
self.grab = GrabStatus::None;
f(PointerInnerHandle { inner: self }, &mut DefaultGrab);
return;
}
}
f(PointerInnerHandle { inner: self }, &mut **handler); f(PointerInnerHandle { inner: self }, &mut **handler);
} }
GrabStatus::None => { GrabStatus::None => {