version 1.3, 2009/07/26 12:58:44 |
version 1.4, 2009/10/10 10:02:48 |
|
|
{ |
{ |
struct cmd_srcdst_data *data = self->data; |
struct cmd_srcdst_data *data = self->data; |
struct session *src, *dst; |
struct session *src, *dst; |
|
struct session_group *sg_src, *sg_dst; |
struct winlink *wl_src, *wl_dst; |
struct winlink *wl_src, *wl_dst; |
struct window *w; |
struct window *w; |
|
|
|
|
if ((wl_dst = cmd_find_window(ctx, data->dst, &dst)) == NULL) |
if ((wl_dst = cmd_find_window(ctx, data->dst, &dst)) == NULL) |
return (-1); |
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) |
if (wl_dst->window == wl_src->window) |
return (0); |
return (0); |
|
|
|
|
if (src != dst) |
if (src != dst) |
session_select(src, wl_src->idx); |
session_select(src, wl_src->idx); |
} |
} |
server_redraw_session(src); |
session_group_synchronize_from(src); |
if (src != dst) |
server_redraw_session_group(src); |
server_redraw_session(dst); |
if (src != dst) { |
|
session_group_synchronize_from(dst); |
|
server_redraw_session_group(dst); |
|
} |
recalculate_sizes(); |
recalculate_sizes(); |
|
|
return (0); |
return (0); |