From e89689634df471fbfea1ded159ac25b728acebb3 Mon Sep 17 00:00:00 2001 From: dailz Date: Tue, 14 Apr 2026 16:50:48 +0800 Subject: [PATCH] fix(state): handle BufferParamsEvent::Failed to prevent silent hang Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/state.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/state.rs b/src/state.rs index dca2c89..1e83f40 100644 --- a/src/state.rs +++ b/src/state.rs @@ -935,8 +935,8 @@ impl Dispatch for State { impl Dispatch for State { fn event( - _state: &mut Self, - _proxy: &ZwpLinuxBufferParamsV1, + state: &mut Self, + proxy: &ZwpLinuxBufferParamsV1, event: ::Event, _data: &(), _conn: &wayland_client::Connection, @@ -948,6 +948,21 @@ impl Dispatch for State { } 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(); } _ => {} }