From 4bd4d7627602aa7f5168bf1c0f360647035e4426 Mon Sep 17 00:00:00 2001 From: tidely <43219534+tidely@users.noreply.github.com> Date: Wed, 29 Oct 2025 18:53:06 +0200 Subject: [PATCH] gpui: Fix GPUI prompts from bleeding clicks into lower windows (#41442) Closes #41180 When using the fallback prompt renderer (default on Wayland), clicks would bleed through into underlying windows. When the click happens to hit a button that creates a prompt, it drops the `RenderablePromptHandle` which is contained within `Window`, causing the `Receiver` which returns the index of the clicked `PromptButton` to return `Err(Canceled)` even though a button was pressed. This bug appears in the GPUI `window.rs` example, which can be ran using `cargo run -p gpui --example window`. MacOS has a native `PromptRenderer` and thus needs additional code to be adjusted to be able to reproduce the issue. Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/gpui/src/window/prompts.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/gpui/src/window/prompts.rs b/crates/gpui/src/window/prompts.rs index 778ee1dab0eb8312161dcbca0ddf8964afe0c6bb..63ad1668bec298a6b59d218bf7d4ca7cdce11e8c 100644 --- a/crates/gpui/src/window/prompts.rs +++ b/crates/gpui/src/window/prompts.rs @@ -142,6 +142,7 @@ impl Render for FallbackPromptRenderer { .id(ix) .on_click(cx.listener(move |_, _, _, cx| { cx.emit(PromptResponse(ix)); + cx.stop_propagation(); })) }));