--- rxvt-unicode/src/scrollbar-xterm.C 2004/08/15 22:09:24 1.15 +++ rxvt-unicode/src/scrollbar-xterm.C 2004/08/23 19:57:33 1.17 @@ -32,10 +32,10 @@ const unsigned char x_stp_bits[] = { 0xaa, 0x55 }; int -rxvt_term::scrollbar_show_xterm (int update __attribute__ ((unused)), int last_top, int last_bot, int scrollbar_len) +rxvt_term::scrollbar_show_xterm (int update, int last_top, int last_bot, int scrollbar_len) { - int xsb = 0; - int sbwidth = scrollBar.width - 1; + int xsb = 0; + int sbwidth = scrollBar.width - 1; if ((scrollBar.init & R_SB_XTERM) == 0) { @@ -49,26 +49,31 @@ rxvt_fatal ("can't create bitmap\n"); gcvalue.fill_style = FillOpaqueStippled; - gcvalue.foreground = pix_colors[Color_fg]; - gcvalue.background = pix_colors[Color_bg]; + gcvalue.foreground = pix_colors_focused[Color_fg]; + gcvalue.background = pix_colors_focused[Color_bg]; xscrollbarGC = XCreateGC (display->display, scrollBar.win, GCForeground | GCBackground | GCFillStyle | GCStipple, &gcvalue); - gcvalue.foreground = pix_colors[Color_border]; + gcvalue.foreground = pix_colors_focused[Color_border]; ShadowGC = XCreateGC (display->display, scrollBar.win, GCForeground, &gcvalue); } - /* instead of XClearWindow (display->display, scrollBar.win); */ - xsb = (options & Opt_scrollBar_right) ? 1 : 0; - if (last_top < scrollBar.top) - XClearArea (display->display, scrollBar.win, - sb_shadow + xsb, last_top, - sbwidth, (scrollBar.top - last_top), False); - - if (scrollBar.bot < last_bot) - XClearArea (display->display, scrollBar.win, - sb_shadow + xsb, scrollBar.bot, - sbwidth, (last_bot - scrollBar.bot), False); + + if (update) + { + xsb = (options & Opt_scrollBar_right) ? 1 : 0; + if (last_top < scrollBar.top) + XClearArea (display->display, scrollBar.win, + sb_shadow + xsb, last_top, + sbwidth, (scrollBar.top - last_top), False); + + if (scrollBar.bot < last_bot) + XClearArea (display->display, scrollBar.win, + sb_shadow + xsb, scrollBar.bot, + sbwidth, (last_bot - scrollBar.bot), False); + } + else + XClearWindow (display->display, scrollBar.win); /* scrollbar slider */ XFillRectangle (display->display, scrollBar.win, xscrollbarGC,