aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authornicm <nicm>2015-09-14 11:34:50 +0000
committernicm <nicm>2015-09-14 11:34:50 +0000
commitaf16ce6ad9170e6a48e79e3af696f60daa2bae1d (patch)
tree740fb5b23280446e3143d2084362f01128474115 /window.c
parent16efa8483888e326aed2c05a01b63b45a2b118ef (diff)
downloadrtmux-af16ce6ad9170e6a48e79e3af696f60daa2bae1d.tar.gz
rtmux-af16ce6ad9170e6a48e79e3af696f60daa2bae1d.tar.bz2
rtmux-af16ce6ad9170e6a48e79e3af696f60daa2bae1d.zip
When the active pane changes, redraw panes if the style has
changed. From Cam Hutchison.
Diffstat (limited to 'window.c')
-rw-r--r--window.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/window.c b/window.c
index e5decdc4..9e77adcd 100644
--- a/window.c
+++ b/window.c
@@ -423,6 +423,30 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
return (1);
}
+void
+window_redraw_active_switch(struct window *w, struct window_pane *wp)
+{
+ const struct grid_cell *agc, *wgc;
+
+ if (wp == w->active)
+ return;
+
+ /*
+ * If window-style and window-active-style are the same, we don't need
+ * to redraw panes when switching active panes. Otherwise, if the
+ * active or inactive pane do not have a custom style, they will need
+ * to be redrawn.
+ */
+ agc = options_get_style(&w->options, "window-active-style");
+ wgc = options_get_style(&w->options, "window-style");
+ if (style_equal(agc, wgc))
+ return;
+ if (style_equal(&grid_default_cell, &w->active->colgc))
+ w->active->flags |= PANE_REDRAW;
+ if (style_equal(&grid_default_cell, &wp->colgc))
+ wp->flags |= PANE_REDRAW;
+}
+
struct window_pane *
window_get_active_at(struct window *w, u_int x, u_int y)
{