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:
parent
6193569596
commit
887fab0936
3 changed files with 8 additions and 7 deletions
|
|
@ -58,7 +58,7 @@ impl WlCompositor {
|
||||||
.state
|
.state
|
||||||
.xwayland
|
.xwayland
|
||||||
.queue
|
.queue
|
||||||
.push(XWaylandEvent::SurfaceCreated(surface.clone()));
|
.push(XWaylandEvent::SurfaceCreated(surface.id));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,7 @@ use {
|
||||||
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1,
|
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1,
|
||||||
},
|
},
|
||||||
wl_seat::SeatId,
|
wl_seat::SeatId,
|
||||||
wl_surface::{
|
wl_surface::x_surface::xwindow::{Xwindow, XwindowData},
|
||||||
x_surface::xwindow::{Xwindow, XwindowData},
|
|
||||||
WlSurface,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
io_uring::IoUringError,
|
io_uring::IoUringError,
|
||||||
state::State,
|
state::State,
|
||||||
|
|
@ -273,7 +270,7 @@ async fn log_xwayland(state: Rc<State>, stderr: OwnedFd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum XWaylandEvent {
|
pub enum XWaylandEvent {
|
||||||
SurfaceCreated(Rc<WlSurface>),
|
SurfaceCreated(WlSurfaceId),
|
||||||
SurfaceDestroyed(WlSurfaceId),
|
SurfaceDestroyed(WlSurfaceId),
|
||||||
Configure(Rc<Xwindow>),
|
Configure(Rc<Xwindow>),
|
||||||
Activate(Rc<XwindowData>),
|
Activate(Rc<XwindowData>),
|
||||||
|
|
|
||||||
|
|
@ -1421,7 +1421,11 @@ impl Wm {
|
||||||
window.map_status_changed();
|
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) {
|
let data = match self.windows_by_surface_id.get(&surface.id) {
|
||||||
Some(w) => w.clone(),
|
Some(w) => w.clone(),
|
||||||
_ => return,
|
_ => return,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue