diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-08 21:02:25 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-08 21:02:25 +0100 |
commit | 4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31 (patch) | |
tree | e7b208da1146e64e5f91d978375478d0f3fb792b /cmd.c | |
parent | b24d7d9c95c2083f14715f95a5a96fcb5204eca0 (diff) | |
parent | f9682d2e558c58117f23f302ce35d9b319151189 (diff) | |
download | rtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.tar.gz rtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.tar.bz2 rtmux-4bc45fc95aa1a7af5bf97b4c1f66ccbc70790c31.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -509,17 +509,22 @@ cmd_mouse_window(struct mouse_event *m, struct session **sp) { struct session *s; struct window *w; + struct winlink *wl; - if (!m->valid || m->s == -1 || m->w == -1) + if (!m->valid) return (NULL); - if ((s = session_find_by_id(m->s)) == NULL) + if (m->s == -1 || (s = session_find_by_id(m->s)) == NULL) return (NULL); - if ((w = window_find_by_id(m->w)) == NULL) - return (NULL); - + if (m->w == -1) + wl = s->curw; + else { + if ((w = window_find_by_id(m->w)) == NULL) + return (NULL); + wl = winlink_find_by_window(&s->windows, w); + } if (sp != NULL) *sp = s; - return (winlink_find_by_window(&s->windows, w)); + return (wl); } /* Get current mouse pane if any. */ |