diff options
author | nicm <nicm> | 2020-04-13 10:59:58 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-13 10:59:58 +0000 |
commit | 04cdd035250b93b728678d515b69690653dced4e (patch) | |
tree | 34edc5f4affb9a640a95c7d531eb06770b6ea3c9 /cmd-swap-window.c | |
parent | c20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (diff) |
Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).
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); |