--- rxvt-unicode/src/scrollbar.C 2011/08/22 17:08:52 1.67 +++ rxvt-unicode/src/scrollbar.C 2011/08/28 18:48:41 1.71 @@ -31,11 +31,9 @@ /* * Map or unmap a scrollbar. Returns non-zero upon change of state */ -int +void scrollBar_t::map (int map) { - int change = 0; - if (map) { state = STATE_IDLE; @@ -46,17 +44,13 @@ if (win) { XMapWindow (term->dpy, win); - change = 1; } } else { - state = 0; + state = STATE_OFF; XUnmapWindow (term->dpy, win); - change = 1; } - - return change; } void @@ -118,10 +112,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,7 +136,6 @@ scrollBar_t::setup (rxvt_term *term) { int i; - short style, width; const char *scrollalign, *scrollstyle, *thickness; this->term = term; @@ -199,9 +191,6 @@ shadow = SHADOW_WIDTH; # endif - this->style = style; - this->width = width; - /* align = R_SB_ALIGN_CENTRE; */ if (scrollalign) { @@ -210,7 +199,7 @@ else if (strncasecmp (scrollalign, "bottom", 6) == 0) align = R_SB_ALIGN_BOTTOM; } - last_state = 0; + last_state = STATE_OFF; /* cursor scrollBar: Black-on-White */ leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr); }