diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-04-13 14:01:45 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-04-13 14:01:45 +0100 |
commit | 8f2b5d714a9f854c9583cab8bae70a2c7323fa00 (patch) | |
tree | 4e887ff4a1fcb3703fb0a1fcaa751183cff24c12 /cmd-swap-window.c | |
parent | b117c3b81217a11946ac784cfbe2ef1f3725b207 (diff) | |
parent | 04cdd035250b93b728678d515b69690653dced4e (diff) | |
download | rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.tar.gz rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.tar.bz2 rtmux-8f2b5d714a9f854c9583cab8bae70a2c7323fa00.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-swap-window.c')
-rw-r--r-- | cmd-swap-window.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cmd-swap-window.c b/cmd-swap-window.c index 9ed1e8f1..651a44da 100644 --- a/cmd-swap-window.c +++ b/cmd-swap-window.c @@ -46,20 +46,19 @@ static enum cmd_retval cmd_swap_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct session *src, *dst; + struct cmd_find_state *source = cmdq_get_source(item); + struct cmd_find_state *target = cmdq_get_target(item); + struct session *src = source->s, *dst = target->s; struct session_group *sg_src, *sg_dst; - struct winlink *wl_src, *wl_dst; + struct winlink *wl_src = source->wl, *wl_dst = target->wl; struct window *w_src, *w_dst; - wl_src = item->source.wl; - src = item->source.s; sg_src = session_group_contains(src); - - wl_dst = item->target.wl; - dst = item->target.s; sg_dst = session_group_contains(dst); - if (src != dst && sg_src != NULL && sg_dst != NULL && + if (src != dst && + sg_src != NULL && + sg_dst != NULL && sg_src == sg_dst) { cmdq_error(item, "can't move window, sessions are grouped"); return (CMD_RETURN_ERROR); |