summaryrefslogtreecommitdiffstats
path: root/cmd-swap-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-15 17:42:44 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-15 17:42:44 +0000
commit1e574bb70c2770fe5886fd7327966dfc543e3939 (patch)
tree21daf5e0c06f69035a1b2c43fe2a9d12e41c868f /cmd-swap-pane.c
parent537c32b6b61d93b3489fee9cea26cd808125e265 (diff)
Get rid of the PANE_HIDDEN flag in favour of a function, and moving the
decision for whether or not a pane should be drawn out of the layout code and into the redraw code. This is needed for the new layout design, getting it in now to make that easier to work on.
Diffstat (limited to 'cmd-swap-pane.c')
-rw-r--r--cmd-swap-pane.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/cmd-swap-pane.c b/cmd-swap-pane.c
index 05ab0a99..e3066ce7 100644
--- a/cmd-swap-pane.c
+++ b/cmd-swap-pane.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-swap-pane.c,v 1.7 2009-07-14 06:43:33 nicm Exp $ */
+/* $Id: cmd-swap-pane.c,v 1.8 2009-07-15 17:42:43 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -158,7 +158,6 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window *w;
struct window_pane *tmp_wp, *src_wp, *dst_wp;
u_int xx, yy;
- int flags;
if (data == NULL)
return (0);
@@ -210,15 +209,10 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
xx = src_wp->xoff;
yy = src_wp->yoff;
- flags = src_wp->flags;
src_wp->xoff = dst_wp->xoff;
src_wp->yoff = dst_wp->yoff;
- src_wp->flags &= ~PANE_HIDDEN;
- src_wp->flags |= dst_wp->flags & PANE_HIDDEN;
dst_wp->xoff = xx;
dst_wp->yoff = yy;
- dst_wp->flags &= ~PANE_HIDDEN;
- dst_wp->flags |= flags & PANE_HIDDEN;
xx = src_wp->sx;
yy = src_wp->sy;
@@ -227,7 +221,7 @@ cmd_swap_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
if (!data->flag_detached) {
tmp_wp = dst_wp;
- if (tmp_wp->flags & PANE_HIDDEN)
+ if (!window_pane_visible(tmp_wp))
tmp_wp = src_wp;
window_set_active_pane(w, tmp_wp);
layout_refresh(w, 0);