=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-swap-window.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/tmux/cmd-swap-window.c 2009/07/26 12:58:44 1.3 --- src/usr.bin/tmux/cmd-swap-window.c 2009/10/10 10:02:48 1.4 *************** *** 1,4 **** ! /* $OpenBSD: cmd-swap-window.c,v 1.3 2009/07/26 12:58:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-swap-window.c,v 1.4 2009/10/10 10:02:48 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 44,49 **** --- 44,50 ---- { struct cmd_srcdst_data *data = self->data; struct session *src, *dst; + struct session_group *sg_src, *sg_dst; struct winlink *wl_src, *wl_dst; struct window *w; *************** *** 52,57 **** --- 53,66 ---- if ((wl_dst = cmd_find_window(ctx, data->dst, &dst)) == NULL) return (-1); + sg_src = session_group_find(src); + sg_dst = session_group_find(dst); + if (src != dst && + sg_src != NULL && sg_dst != NULL && sg_src == sg_dst) { + ctx->error(ctx, "can't move window, sessions are grouped"); + return (-1); + } + if (wl_dst->window == wl_src->window) return (0); *************** *** 64,72 **** if (src != dst) session_select(src, wl_src->idx); } ! server_redraw_session(src); ! if (src != dst) ! server_redraw_session(dst); recalculate_sizes(); return (0); --- 73,84 ---- if (src != dst) session_select(src, wl_src->idx); } ! session_group_synchronize_from(src); ! server_redraw_session_group(src); ! if (src != dst) { ! session_group_synchronize_from(dst); ! server_redraw_session_group(dst); ! } recalculate_sizes(); return (0);