mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
Merge branch 'obsd-master'
This commit is contained in:
17
cmd.c
17
cmd.c
@ -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. */
|
||||
|
Reference in New Issue
Block a user