summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-08-17 18:01:09 +0100
committerThomas Adam <thomas@xteddy.org>2023-08-17 18:01:09 +0100
commite3a8b8434cf656164d74ae115ebccd432144ed2c (patch)
tree45b6061279b4b6155e0b6dd921b42a9341d3e98d /cmd.c
parent3d93b0c52ecd6d5b321fef777d49c360c9fbe069 (diff)
parent8636848e6348bb0e38cd6aaaadbe61e15181bc8f (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index ed4f9940..32c00b4e 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;