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:
19
src/state.rs
19
src/state.rs
@@ -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();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user