fix(state): handle BufferParamsEvent::Failed to prevent silent hang

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
dailz
2026-04-14 16:50:48 +08:00
parent 6835f1f6cd
commit e89689634d

View File

@@ -935,8 +935,8 @@ impl<S: CaptureSource> Dispatch<ZwpLinuxDmabufFeedbackV1, ()> for State<S> {
impl<S: CaptureSource> Dispatch<ZwpLinuxBufferParamsV1, ()> for State<S> {
fn event(
_state: &mut Self,
_proxy: &ZwpLinuxBufferParamsV1,
state: &mut Self,
proxy: &ZwpLinuxBufferParamsV1,
event: <ZwpLinuxBufferParamsV1 as Proxy>::Event,
_data: &(),
_conn: &wayland_client::Connection,
@@ -948,6 +948,21 @@ impl<S: CaptureSource> Dispatch<ZwpLinuxBufferParamsV1, ()> for State<S> {
}
BufferParamsEvent::Failed => {
tracing::error!("DMA-BUF buffer creation failed");
state.errored = true;
match mem::replace(&mut state.in_flight_surface, InFlightSurface::None) {
InFlightSurface::CopyQueued {
surface: _,
drm_map: _,
frame: _,
buffer,
} => {
drop(buffer);
}
other => {
state.in_flight_surface = other;
}
}
proxy.destroy();
}
_ => {}
}