From e272a947a4e7a18b59fd1f09a054af7c4aadc950 Mon Sep 17 00:00:00 2001 From: ayin Date: Mon, 31 Dec 2007 15:45:29 +0000 Subject: [PATCH] Init graphics contexts for rxvt scrollbar in scrollbar_show_rxvt. --- src/init.C | 9 --------- src/scrollbar-rxvt.C | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/init.C b/src/init.C index c9d27a2e..b71f23f2 100644 --- a/src/init.C +++ b/src/init.C @@ -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]) diff --git a/src/scrollbar-rxvt.C b/src/scrollbar-rxvt.C index 7dd6396e..216e0714 100644 --- a/src/scrollbar-rxvt.C +++ b/src/scrollbar-rxvt.C @@ -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]); -- 2.34.1