From 671f456761fc66649260e831ceee36ec3d4ba9ca Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 05:34:56 +0200 Subject: Merging upstream version 3.4. Signed-off-by: Daniel Baumann --- cmd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index ed4f994..32c00b4 100644 --- a/cmd.c +++ b/cmd.c @@ -812,10 +812,14 @@ cmd_mouse_pane(struct mouse_event *m, struct session **sp, if ((wl = cmd_mouse_window(m, sp)) == NULL) return (NULL); - if ((wp = window_pane_find_by_id(m->wp)) == NULL) - return (NULL); - if (!window_has_pane(wl->window, wp)) - return (NULL); + if (m->wp == -1) + wp = wl->window->active; + else { + if ((wp = window_pane_find_by_id(m->wp)) == NULL) + return (NULL); + if (!window_has_pane(wl->window, wp)) + return (NULL); + } if (wlp != NULL) *wlp = wl; -- cgit v1.2.3