Init graphics contexts for rxvt scrollbar in scrollbar_show_rxvt.
authorayin <ayin>
Mon, 31 Dec 2007 15:45:29 +0000 (15:45 +0000)
committerayin <ayin>
Mon, 31 Dec 2007 15:45:29 +0000 (15:45 +0000)
src/init.C
src/scrollbar-rxvt.C

index c9d27a2ebaed0fb48b8584420a867bdc8be8b678..b71f23f2e4284f71120993f404fe60584e9480dd 100644 (file)
@@ -1115,15 +1115,6 @@ rxvt_term::create_windows (int argc, const char *const *argv)
 
   drawable = new rxvt_drawable (this, vt);
 
-#ifdef RXVT_SCROLLBAR
-  gcvalue.foreground = pix_colors[Color_topShadow];
-  topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
-  gcvalue.foreground = pix_colors[Color_bottomShadow];
-  botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
-  gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)];
-  scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
-#endif
-
 #ifdef OFF_FOCUS_FADING
   // initially we are in unfocused state
   if (rs[Rs_fade])
index 7dd6396ebd05ad921d3c800f39261dc9f99655e7..216e07144c902977cf5fc37e60ef691e667a82f6 100644 (file)
@@ -154,8 +154,16 @@ rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scro
 
   if ((scrollBar.init & R_SB_RXVT) == 0)
     {
+      XGCValues gcvalue;
+
       scrollBar.init |= R_SB_RXVT;
 
+      gcvalue.foreground = pix_colors[Color_topShadow];
+      topShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
+      gcvalue.foreground = pix_colors[Color_bottomShadow];
+      botShadowGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
+      gcvalue.foreground = pix_colors[ (depth <= 2 ? Color_fg : Color_scroll)];
+      scrollbarGC = XCreateGC (dpy, vt, GCForeground, &gcvalue);
       if (sbshadow)
         {
           XSetWindowBackground (dpy, scrollBar.win, pix_colors_focused[Color_trough]);