1
0
Fork 0
forked from wry/wry

xwayland: don't send raw wl_surface's to xwm

This handles a race where the surface was already destroyed when the
message was handled.
This commit is contained in:
Julian Orth 2022-10-16 20:58:19 +02:00
parent 6193569596
commit 887fab0936
3 changed files with 8 additions and 7 deletions

View file

@ -1421,7 +1421,11 @@ impl Wm {
window.map_status_changed();
}
async fn handle_xwayland_surface_created(&mut self, surface: Rc<WlSurface>) {
async fn handle_xwayland_surface_created(&mut self, surface: WlSurfaceId) {
let surface = match self.client.lookup(surface) {
Ok(s) => s,
_ => return,
};
let data = match self.windows_by_surface_id.get(&surface.id) {
Some(w) => w.clone(),
_ => return,