--- rxvt-unicode/src/screen.C 2011/01/20 14:02:35 1.363 +++ rxvt-unicode/src/screen.C 2011/02/01 00:41:01 1.368 @@ -1687,7 +1687,7 @@ ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); #ifdef HAVE_BG_PIXMAP - if (bgPixmap.pixmap == None) + if (bg_pixmap == None) #endif XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); @@ -2033,7 +2033,7 @@ unsigned int old_screen_flags = screen.flags; char have_bg = 0; #ifdef HAVE_BG_PIXMAP - have_bg = bgPixmap.pixmap != None; + have_bg = bg_pixmap != None; #endif ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ @@ -2510,28 +2510,52 @@ } void -rxvt_term::scr_recolour () NOTHROW +rxvt_term::scr_recolour (bool refresh) NOTHROW { + bool transparent = false; + #ifdef HAVE_BG_PIXMAP - bgPixmap.apply (); -#else + if (bg_pixmap != None) + { +# ifdef ENABLE_TRANSPARENCY + if (bg_flags & BG_IS_TRANSPARENT) + { + XSetWindowBackgroundPixmap (dpy, parent[0], bg_pixmap); + XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); + + transparent = true; + } + else +# endif + { + XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); + XSetWindowBackgroundPixmap (dpy, vt, bg_pixmap); + } + } + else +#endif + { + XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); + XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); + } - XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); XClearWindow (dpy, parent[0]); - XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); if (scrollBar.win) { - XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); + if (transparent) + XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); + else + XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); scrollBar.state = STATE_IDLE; scrollBar.show (0); } -#endif - - /* bgPixmap.apply () does not do the following : */ - scr_clear (); - scr_touch (true); + if (refresh) + { + scr_clear (); + scr_touch (true); + } want_refresh = 1; } @@ -2720,24 +2744,21 @@ { if (prop == None) /* check for failed XConvertSelection */ { + int selnum = selection_type & Sel_whereMask; + + if (selnum == Sel_direct) + selection_type = 0; + if ((selection_type & Sel_CompoundText)) { - int selnum = selection_type & Sel_whereMask; - selection_type = 0; - if (selnum != Sel_direct) - selection_request_other (XA_STRING, selnum); + selection_request_other (XA_STRING, selnum); } if ((selection_type & Sel_UTF8String)) { - int selnum = selection_type & Sel_whereMask; - selection_type = Sel_CompoundText; - if (selnum != Sel_direct) - selection_request_other (xa[XA_COMPOUND_TEXT], selnum); - else - selection_type = 0; + selection_request_other (xa[XA_COMPOUND_TEXT], selnum); } return; @@ -2820,7 +2841,7 @@ * pass through again trying CUT_BUFFER0 if we've come from * XConvertSelection () but nothing was presented */ - selection_paste (display->root, XA_CUT_BUFFER0, False); + selection_paste (display->root, XA_CUT_BUFFER0, false); } goto bailout;