=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-swap-pane.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- src/usr.bin/tmux/cmd-swap-pane.c 2009/07/14 07:23:36 1.4 +++ src/usr.bin/tmux/cmd-swap-pane.c 2009/07/19 13:21:40 1.5 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-swap-pane.c,v 1.4 2009/07/14 07:23:36 nicm Exp $ */ +/* $OpenBSD: cmd-swap-pane.c,v 1.5 2009/07/19 13:21:40 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -157,6 +157,7 @@ struct winlink *wl; struct window *w; struct window_pane *tmp_wp, *src_wp, *dst_wp; + struct layout_cell *lc; u_int xx, yy; if (data == NULL) @@ -207,12 +208,15 @@ else TAILQ_INSERT_AFTER(&w->panes, tmp_wp, src_wp, entry); + lc = src_wp->layout_cell; xx = src_wp->xoff; yy = src_wp->yoff; - src_wp->xoff = dst_wp->xoff; - src_wp->yoff = dst_wp->yoff; - dst_wp->xoff = xx; - dst_wp->yoff = yy; + src_wp->layout_cell = dst_wp->layout_cell; + if (src_wp->layout_cell != NULL) + src_wp->layout_cell->wp = src_wp; + dst_wp->layout_cell = lc; + if (dst_wp->layout_cell != NULL) + dst_wp->layout_cell->wp = dst_wp; xx = src_wp->sx; yy = src_wp->sy; @@ -224,8 +228,8 @@ if (!window_pane_visible(tmp_wp)) tmp_wp = src_wp; window_set_active_pane(w, tmp_wp); - layout_refresh(w, 0); } + server_redraw_window(w); return (0); }