--- rxvt-unicode/src/scrollbar-rxvt.C 2004/06/21 22:24:07 1.10 +++ rxvt-unicode/src/scrollbar-rxvt.C 2005/02/04 11:41:23 1.17 @@ -23,7 +23,6 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ -#include "scrollbar-rxvt.intpro" /* PROTOS for internal routines */ /*----------------------------------------------------------------------*/ #if defined(RXVT_SCROLLBAR) @@ -84,6 +83,7 @@ #if (SHADOW > 1) /* doubled */ pt[0].x++; + if (dirn == UP) { pt[0].y--; @@ -94,6 +94,7 @@ pt[0].y++; pt[1].y--; } + XDrawLine (display->display, scrollBar.win, top, pt[0].x, pt[0].y, pt[1].x, pt[1].y); #endif @@ -104,6 +105,7 @@ pt[2].y = y + (dirn == UP ? 0 : sz - 1); XDrawLine (display->display, scrollBar.win, bot, pt[2].x, pt[2].y, pt[1].x, pt[1].y); + #if (SHADOW > 1) /* doubled */ pt[1].x--; @@ -124,34 +126,38 @@ } int -rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_top, int last_bot, int scrollbar_len) +rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len) { - int sbshadow = sb_shadow; - int sbwidth = (int)scrollBar.width; + int sbshadow = sb_shadow; + int sbwidth = (int)scrollBar.width; if ((scrollBar.init & R_SB_RXVT) == 0) { scrollBar.init |= R_SB_RXVT; if (sbshadow) { - XSetWindowBackground (display->display, scrollBar.win, PixColors[Color_trough]); + XSetWindowBackground (display->display, scrollBar.win, pix_colors_focused[Color_trough]); XClearWindow (display->display, scrollBar.win); } } else { - /* instead of XClearWindow (display->display, scrollBar.win); */ - if (last_top < scrollBar.top) - XClearArea (display->display, scrollBar.win, - sbshadow, last_top, - sbwidth, (scrollBar.top - last_top), - False); - - if (scrollBar.bot < last_bot) - XClearArea (display->display, scrollBar.win, - sbshadow, scrollBar.bot, - sbwidth, (last_bot - scrollBar.bot), - False); + if (update) + { + if (last_top < scrollBar.top) + XClearArea (display->display, scrollBar.win, + sbshadow, last_top, + sbwidth, (scrollBar.top - last_top), + False); + + if (scrollBar.bot < last_bot) + XClearArea (display->display, scrollBar.win, + sbshadow, scrollBar.bot, + sbwidth, (last_bot - scrollBar.bot), + False); + } + else + XClearWindow (display->display, scrollBar.win); } /* scrollbar slider */ @@ -159,7 +165,7 @@ { int xofs; - if (Options & Opt_scrollBar_right) + if (options & Opt_scrollBar_right) xofs = 0; else xofs = sbshadow ? sbwidth : sbwidth - 1;