aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c57
1 files changed, 26 insertions, 31 deletions
diff --git a/window.c b/window.c
index b0194eaf..8121ba2d 100644
--- a/window.c
+++ b/window.c
@@ -30,8 +30,6 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <util.h>
-#include <vis.h>
#include "tmux.h"
@@ -450,6 +448,15 @@ window_pane_send_resize(struct window_pane *wp, int yadjust)
ws.ws_xpixel = w->xpixel * ws.ws_col;
ws.ws_ypixel = w->ypixel * ws.ws_row;
if (ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
+#ifdef __sun
+ /*
+ * Some versions of Solaris apparently can return an error when
+ * resizing; don't know why this happens, can't reproduce on
+ * other platforms and ignoring it doesn't seem to cause any
+ * issues.
+ */
+ if (errno != EINVAL && errno != ENXIO)
+#endif
fatal("ioctl failed");
}
@@ -488,8 +495,8 @@ window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
void
window_redraw_active_switch(struct window *w, struct window_pane *wp)
{
- struct style *sy1, *sy2;
- int c1, c2;
+ struct grid_cell *gc1, *gc2;
+ int c1, c2;
if (wp == w->active)
return;
@@ -499,18 +506,18 @@ window_redraw_active_switch(struct window *w, struct window_pane *wp)
* If the active and inactive styles or palettes are different,
* need to redraw the panes.
*/
- sy1 = &wp->cached_style;
- sy2 = &wp->cached_active_style;
- if (!style_equal(sy1, sy2))
+ gc1 = &wp->cached_gc;
+ gc2 = &wp->cached_active_gc;
+ if (!grid_cells_look_equal(gc1, gc2))
wp->flags |= PANE_REDRAW;
else {
- c1 = window_pane_get_palette(wp, sy1->gc.fg);
- c2 = window_pane_get_palette(wp, sy2->gc.fg);
+ c1 = window_pane_get_palette(wp, gc1->fg);
+ c2 = window_pane_get_palette(wp, gc2->fg);
if (c1 != c2)
wp->flags |= PANE_REDRAW;
else {
- c1 = window_pane_get_palette(wp, sy1->gc.bg);
- c2 = window_pane_get_palette(wp, sy2->gc.bg);
+ c1 = window_pane_get_palette(wp, gc1->bg);
+ c2 = window_pane_get_palette(wp, gc2->bg);
if (c1 != c2)
wp->flags |= PANE_REDRAW;
}
@@ -865,6 +872,9 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp->fd = -1;
wp->event = NULL;
+ wp->fg = 8;
+ wp->bg = 8;
+
TAILQ_INIT(&wp->modes);
wp->layout_cell = NULL;
@@ -897,6 +907,9 @@ window_pane_destroy(struct window_pane *wp)
free(wp->searchstr);
if (wp->fd != -1) {
+#ifdef HAVE_UTEMPTER
+ utempter_remove_record(wp->fd);
+#endif
bufferevent_free(wp->event);
close(wp->fd);
}
@@ -993,26 +1006,6 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
}
void
-window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc,
- int cursor)
-{
- if (!options_get_number(wp->options, "alternate-screen"))
- return;
- screen_alternate_on(&wp->base, gc, cursor);
- wp->flags |= PANE_REDRAW;
-}
-
-void
-window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc,
- int cursor)
-{
- if (!options_get_number(wp->options, "alternate-screen"))
- return;
- screen_alternate_off(&wp->base, gc, cursor);
- wp->flags |= PANE_REDRAW;
-}
-
-void
window_pane_set_palette(struct window_pane *wp, u_int n, int colour)
{
if (n > 0xff)
@@ -1096,6 +1089,7 @@ window_pane_set_mode(struct window_pane *wp, struct window_pane *swp,
wp->screen = wme->screen;
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
+ server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
@@ -1127,6 +1121,7 @@ window_pane_reset_mode(struct window_pane *wp)
}
wp->flags |= (PANE_REDRAW|PANE_CHANGED);
+ server_redraw_window_borders(wp->window);
server_status_window(wp->window);
notify_pane("pane-mode-changed", wp);
}