=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-redraw.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/screen-redraw.c 2015/05/07 07:16:14 1.31 --- src/usr.bin/tmux/screen-redraw.c 2015/06/04 11:43:51 1.32 *************** *** 1,4 **** ! /* $OpenBSD: screen-redraw.c,v 1.31 2015/05/07 07:16:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: screen-redraw.c,v 1.32 2015/06/04 11:43:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 26,33 **** int screen_redraw_cell_border(struct client *, u_int, u_int); int screen_redraw_check_cell(struct client *, u_int, u_int, struct window_pane **); ! int screen_redraw_check_active(u_int, u_int, int, struct window *, ! struct window_pane *); void screen_redraw_draw_borders(struct client *, int, u_int); void screen_redraw_draw_panes(struct client *, u_int); --- 26,33 ---- int screen_redraw_cell_border(struct client *, u_int, u_int); int screen_redraw_check_cell(struct client *, u_int, u_int, struct window_pane **); ! int screen_redraw_check_is(u_int, u_int, int, struct window *, ! struct window_pane *, struct window_pane *); void screen_redraw_draw_borders(struct client *, int, u_int); void screen_redraw_draw_panes(struct client *, u_int); *************** *** 175,187 **** return (CELL_OUTSIDE); } ! /* Check active pane indicator. */ int ! screen_redraw_check_active(u_int px, u_int py, int type, struct window *w, ! struct window_pane *wp) { /* Is this off the active pane border? */ ! if (screen_redraw_cell_border1(w->active, px, py) != 1) return (0); /* If there are more than two panes, that's enough. */ --- 175,187 ---- return (CELL_OUTSIDE); } ! /* Check if the border of a particular pane. */ int ! screen_redraw_check_is(u_int px, u_int py, int type, struct window *w, ! struct window_pane *wantwp, struct window_pane *wp) { /* Is this off the active pane border? */ ! if (screen_redraw_cell_border1(wantwp, px, py) != 1) return (0); /* If there are more than two panes, that's enough. */ *************** *** 196,202 **** if (wp->xoff == 0 && wp->sx == w->sx) { /* This can either be the top pane or the bottom pane. */ if (wp->yoff == 0) { /* top pane */ ! if (wp == w->active) return (px <= wp->sx / 2); return (px > wp->sx / 2); } --- 196,202 ---- if (wp->xoff == 0 && wp->sx == w->sx) { /* This can either be the top pane or the bottom pane. */ if (wp->yoff == 0) { /* top pane */ ! if (wp == wantwp) return (px <= wp->sx / 2); return (px > wp->sx / 2); } *************** *** 207,213 **** if (wp->yoff == 0 && wp->sy == w->sy) { /* This can either be the left pane or the right pane. */ if (wp->xoff == 0) { /* left pane */ ! if (wp == w->active) return (py <= wp->sy / 2); return (py > wp->sy / 2); } --- 207,213 ---- if (wp->yoff == 0 && wp->sy == w->sy) { /* This can either be the left pane or the right pane. */ if (wp->xoff == 0) { /* left pane */ ! if (wp == wantwp) return (py <= wp->sy / 2); return (py > wp->sy / 2); } *************** *** 274,286 **** void screen_redraw_draw_borders(struct client *c, int status, u_int top) { ! struct window *w = c->session->curw->window; struct options *oo = &w->options; struct tty *tty = &c->tty; struct window_pane *wp; ! struct grid_cell active_gc, other_gc, msg_gc; u_int i, j, type, msgx = 0, msgy = 0; ! int small, flags; char msg[256]; const char *tmp; size_t msglen = 0; --- 274,288 ---- void screen_redraw_draw_borders(struct client *c, int status, u_int top) { ! struct session *s = c->session; ! struct window *w = s->curw->window; struct options *oo = &w->options; struct tty *tty = &c->tty; struct window_pane *wp; ! struct grid_cell m_active_gc, active_gc, m_other_gc, other_gc; ! struct grid_cell msg_gc; u_int i, j, type, msgx = 0, msgy = 0; ! int active, small, flags; char msg[256]; const char *tmp; size_t msglen = 0; *************** *** 314,328 **** style_apply(&active_gc, oo, "pane-active-border-style"); active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET; for (j = 0; j < tty->sy - status; j++) { for (i = 0; i < tty->sx; i++) { type = screen_redraw_check_cell(c, i, j, &wp); if (type == CELL_INSIDE) continue; ! if (type == CELL_OUTSIDE && ! small && i > msgx && j == msgy) continue; ! if (screen_redraw_check_active(i, j, type, w, wp)) tty_attributes(tty, &active_gc, NULL); else tty_attributes(tty, &other_gc, NULL); --- 316,344 ---- style_apply(&active_gc, oo, "pane-active-border-style"); active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET; + memcpy(&m_other_gc, &other_gc, sizeof m_other_gc); + m_other_gc.attr ^= GRID_ATTR_REVERSE; + memcpy(&m_active_gc, &active_gc, sizeof m_active_gc); + m_active_gc.attr ^= GRID_ATTR_REVERSE; + for (j = 0; j < tty->sy - status; j++) { for (i = 0; i < tty->sx; i++) { type = screen_redraw_check_cell(c, i, j, &wp); if (type == CELL_INSIDE) continue; ! if (type == CELL_OUTSIDE && small && ! i > msgx && j == msgy) continue; ! active = screen_redraw_check_is(i, j, type, w, ! w->active, wp); ! if (server_is_marked(s, s->curw, marked_window_pane) && ! screen_redraw_check_is(i, j, type, w, ! marked_window_pane, wp)) { ! if (active) ! tty_attributes(tty, &m_active_gc, NULL); ! else ! tty_attributes(tty, &m_other_gc, NULL); ! } else if (active) tty_attributes(tty, &active_gc, NULL); else tty_attributes(tty, &other_gc, NULL);