--- rxvt-unicode/src/scrollbar.C 2011/04/07 12:19:41 1.66 +++ rxvt-unicode/src/scrollbar.C 2011/08/25 18:01:28 1.69 @@ -51,7 +51,7 @@ } else { - state = 0; + state = STATE_OFF; XUnmapWindow (term->dpy, win); change = 1; } @@ -118,10 +118,9 @@ int sb_top = term->view_start - term->top_row; int sb_bot = sb_top + (term->nrow - 1); int sb_len = max (term->nrow - 1 - term->top_row, 1); - int sb_size = (sb_bot - sb_top) * size (); top = beg + (sb_top * size ()) / sb_len; - bot = top + sb_size / sb_len + min_height () + (sb_size % sb_len > 0); + bot = top + ecb_div_ru ((sb_bot - sb_top) * size (), sb_len) + min_height (); /* no change */ if (top == last_top && bot == last_bot @@ -143,8 +142,9 @@ scrollBar_t::setup (rxvt_term *term) { int i; - short style, width; + short width; const char *scrollalign, *scrollstyle, *thickness; + enum sb_style style; this->term = term; scrollalign = term->rs[Rs_scrollBar_align]; @@ -210,7 +210,7 @@ else if (strncasecmp (scrollalign, "bottom", 6) == 0) align = R_SB_ALIGN_BOTTOM; } - last_bot = last_state = -1; + last_state = STATE_OFF; /* cursor scrollBar: Black-on-White */ leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); }