From e74a29336b5a7ff71234c5d66feb3e66bca51efb Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 1 Oct 2026 00:29:37 +0800 Subject: [PATCH] fix(terminal): a click beside the covering composer leaves it, as one on the grid does --- src/terminal/composer.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/terminal/composer.rs b/src/terminal/composer.rs index 790f9670..3fea9c34 100644 --- a/src/terminal/composer.rs +++ b/src/terminal/composer.rs @@ -1343,6 +1343,15 @@ impl TerminalView { .pb(px(BOX_INSET)) .bg(cx.theme().background) .occlude() + // Around the box is the terminal as far as a click goes: it + // takes the keyboard out of the box, as a click on the rows + // above does. The layer only hides what is under it. + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, _: &MouseDownEvent, window, cx| { + window.focus(&this.focus_handle, cx); + }), + ) .child(frame) .into_any_element(), None => div() @@ -1816,6 +1825,9 @@ impl TerminalView { MouseButton::Left, cx.listener(|this, _: &MouseDownEvent, window, cx| { window.prevent_default(); + // Not the layer under it, which takes a click as one + // on the terminal. + cx.stop_propagation(); // A click on the frame around the text, not only on // the text, is a click on the box. if !this.composer_focused {