Fix surface data unwrap crash in pending activations handling
Fixes #127.
This commit is contained in:
parent
1d98ee089c
commit
467f3014fb
1 changed files with 9 additions and 6 deletions
|
|
@ -1043,12 +1043,15 @@ impl<C: XConnection> ServerState<C> {
|
||||||
let globals = &mut self.clientside.globals;
|
let globals = &mut self.clientside.globals;
|
||||||
|
|
||||||
globals.pending_activations.retain(|(window, token)| {
|
globals.pending_activations.retain(|(window, token)| {
|
||||||
if let Some(window) = self.windows.get(window) {
|
if let Some(surface) = self
|
||||||
if let Some(key) = window.surface_key {
|
.windows
|
||||||
let surface: &SurfaceData = self.objects[key].as_ref();
|
.get(window)
|
||||||
activation_state.activate::<Self>(&surface.client, token.clone());
|
.and_then(|window| window.surface_key)
|
||||||
return false;
|
.and_then(|key| self.objects.get(key))
|
||||||
}
|
.map(AsRef::<SurfaceData>::as_ref)
|
||||||
|
{
|
||||||
|
activation_state.activate::<Self>(&surface.client, token.clone());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue