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> {
|
impl<S: CaptureSource> Dispatch<ZwpLinuxBufferParamsV1, ()> for State<S> {
|
||||||
fn event(
|
fn event(
|
||||||
_state: &mut Self,
|
state: &mut Self,
|
||||||
_proxy: &ZwpLinuxBufferParamsV1,
|
proxy: &ZwpLinuxBufferParamsV1,
|
||||||
event: <ZwpLinuxBufferParamsV1 as Proxy>::Event,
|
event: <ZwpLinuxBufferParamsV1 as Proxy>::Event,
|
||||||
_data: &(),
|
_data: &(),
|
||||||
_conn: &wayland_client::Connection,
|
_conn: &wayland_client::Connection,
|
||||||
@@ -948,6 +948,21 @@ impl<S: CaptureSource> Dispatch<ZwpLinuxBufferParamsV1, ()> for State<S> {
|
|||||||
}
|
}
|
||||||
BufferParamsEvent::Failed => {
|
BufferParamsEvent::Failed => {
|
||||||
tracing::error!("DMA-BUF buffer creation 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