aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-12-02 18:23:10 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-12-02 18:23:10 +0000
commit8419e997893069e431572bdf51ece7e8356dc8e5 (patch)
tree68a6ba4beb1cf74a2233481756b3fd8c715bc7b7
parentba56989d0f856f4c3a5f1c23bde8bd0c2e62e3f2 (diff)
downloadrtmux-8419e997893069e431572bdf51ece7e8356dc8e5.tar.gz
rtmux-8419e997893069e431572bdf51ece7e8356dc8e5.tar.bz2
rtmux-8419e997893069e431572bdf51ece7e8356dc8e5.zip
The tty code already stores attributes and doesn't modify them if unaltered, so the screen drawing code doesn't need to do so too. This probably also fixes bugs when switching screens where the actual tty attributes may not have been what the draw code (erroneously) expected.
-rw-r--r--screen.c15
-rw-r--r--tmux.h5
2 files changed, 5 insertions, 15 deletions
diff --git a/screen.c b/screen.c
index 07d007b2..5643ece0 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.54 2007-11-30 11:08:35 nicm Exp $ */
+/* $Id: screen.c,v 1.55 2007-12-02 18:23:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -317,9 +317,7 @@ screen_draw_start(struct screen_draw_ctx *ctx, struct screen *s,
ctx->sel.flag = 0;
- ctx->attr = s->attr;
- ctx->colr = s->colr;
-
+ ctx->write(ctx->data, TTY_ATTRIBUTES, s->attr, s->colr);
ctx->write(ctx->data, TTY_SCROLLREGION, 0, screen_last_y(s));
ctx->write(ctx->data, TTY_CURSOROFF);
ctx->write(ctx->data, TTY_MOUSEOFF);
@@ -404,8 +402,7 @@ screen_draw_stop(struct screen_draw_ctx *ctx)
if (ctx->cx != s->cx || ctx->cy != s->cy)
ctx->write(ctx->data, TTY_CURSORMOVE, s->cy, s->cx);
- if (ctx->attr != s->attr || ctx->colr != s->colr)
- ctx->write(ctx->data, TTY_ATTRIBUTES, s->attr, s->colr);
+ ctx->write(ctx->data, TTY_ATTRIBUTES, s->attr, s->colr);
if (s->mode & MODE_BACKGROUND) {
if (s->mode & MODE_BGCURSOR)
@@ -517,11 +514,7 @@ void
screen_draw_set_attributes(
struct screen_draw_ctx *ctx, u_char attr, u_char colr)
{
- if (attr != ctx->attr || colr != ctx->colr) {
- ctx->write(ctx->data, TTY_ATTRIBUTES, attr, colr);
- ctx->attr = attr;
- ctx->colr = colr;
- }
+ ctx->write(ctx->data, TTY_ATTRIBUTES, attr, colr);
}
/* Draw single cell. */
diff --git a/tmux.h b/tmux.h
index 031615d0..488a7d59 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1,4 +1,4 @@
-/* $Id: tmux.h,v 1.107 2007-11-30 11:08:35 nicm Exp $ */
+/* $Id: tmux.h,v 1.108 2007-12-02 18:23:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -406,9 +406,6 @@ struct screen_draw_ctx {
u_int ox;
u_int oy;
- u_char attr;
- u_char colr;
-
struct screen_draw_sel sel;
};