X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=c8051177aa62c1e1153d95ff102e37b6661fe692;hb=2fdcc5e5f633083eb5e52b201862106a2c547df9;hp=dcb80cab4dfa7fb01312b10bb32d0fc8002c6eab;hpb=6dc2b546eca11b198c64c9047106970a8d1f85e8;p=st.git diff --git a/st.c b/st.c index dcb80ca..c805117 100644 --- a/st.c +++ b/st.c @@ -158,8 +158,7 @@ enum escape_state { enum window_state { WIN_VISIBLE = 1, - WIN_REDRAW = 2, - WIN_FOCUSED = 4 + WIN_FOCUSED = 2 }; enum selection_type { @@ -1459,7 +1458,7 @@ treset(void) { term.top = 0; term.bot = term.row - 1; term.mode = MODE_WRAP; - memset(term.trantbl, sizeof(term.trantbl), CS_USA); + memset(term.trantbl, CS_USA, sizeof(term.trantbl)); term.charset = 0; for(i = 0; i < 2; i++) { @@ -2504,7 +2503,6 @@ tstrsequence(uchar c) { strreset(); strescseq.type = c; term.esc |= ESC_STR; - return; } void @@ -2586,7 +2584,6 @@ tcontrolcode(uchar ascii) { } /* only CAN, SUB, \a and C1 chars interrupt a sequence */ term.esc &= ~(ESC_STR_END|ESC_STR); - return; } /* @@ -3741,12 +3738,6 @@ drawregion(int x1, int y1, int x2, int y2) { void expose(XEvent *ev) { - XExposeEvent *e = &ev->xexpose; - - if(xw.state & WIN_REDRAW) { - if(!e->count) - xw.state &= ~WIN_REDRAW; - } redraw(); } @@ -3754,12 +3745,7 @@ void visibility(XEvent *ev) { XVisibilityEvent *e = &ev->xvisibility; - if(e->state == VisibilityFullyObscured) { - xw.state &= ~WIN_VISIBLE; - } else if(!(xw.state & WIN_VISIBLE)) { - /* need a full redraw for next Expose, not just a buf copy */ - xw.state |= WIN_VISIBLE | WIN_REDRAW; - } + MODBIT(xw.state, e->state != VisibilityFullyObscured, WIN_VISIBLE); } void