From 203e36236a7fd90077b6fa9ab2b10168163b67d3 Mon Sep 17 00:00:00 2001 From: Eric Nelson Date: Tue, 2 Jul 2024 17:25:44 -0700 Subject: [PATCH] Better mouse handling --- wezterm-gui/src/termwindow/mouseevent.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rs index f70db22ceac..20917bf386d 100644 --- a/wezterm-gui/src/termwindow/mouseevent.rs +++ b/wezterm-gui/src/termwindow/mouseevent.rs @@ -667,12 +667,18 @@ impl super::TermWindow { Some(MouseCapture::TerminalPane(_)) ); - //is there a better place to put this? - if self.is_float_active() { - return; - } + let panes = if let Some(float_pane) = self.get_float_pane_to_render() { + if position.column >= float_pane.left && position.column <= float_pane.left + float_pane.width + && position.row as usize >= float_pane.top && position.row as usize <= float_pane.top + float_pane.height { + vec![float_pane] + } else { + return + } + } else { + self.get_panes_to_render() + }; - for pos in self.get_panes_to_render() { + for pos in panes { if !is_already_captured && row >= pos.top as i64 && row <= (pos.top + pos.height) as i64