WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look.
DUMB: support tex fonts
+ - use double-buffered drawing for xft fonts only. On many driver/hardware
+ combination this actually increases xft drawing speed, at the expense
+ of more network bandwidth and slight nausea on the side of the author.
- readline perl extension now requires shift-click instead of a normal
click.
+ - disabled graphics-exposures on the main drawing GC, report any
+ refresh bugs please.
- improve property handling for -pe tabbed: avoid unnecessary property
changes (for kde's benefit) at the expense of extra round-trips,
improve size hint setting.
/* graphics context for the vt window */
gcvalue.foreground = pix_colors[Color_fg];
gcvalue.background = pix_colors[Color_bg];
- gcvalue.graphics_exposures = 1;
+ gcvalue.graphics_exposures = 0;
gc = XCreateGC (dpy, vt,
GCForeground | GCBackground | GCGraphicsExposures,
dTermDisplay;
dTermGC;
- if (color == Color_bg)
+ if (color < 0 || color == Color_bg)
XClearArea (disp, d, x, y, w, h, false);
- else if (color >= 0)
+ else
{
#if XFT
XftDrawRect (d, &term->pix_colors[color].c, x, y, w, h);
int w = term->fwidth * len;
int h = term->fheight;
- bool buffered = false;
+ bool buffered = !term->am_transparent // we aren't transparent
+ || term->am_pixmap_trans // we have a pixmap
+ || bg >= 0; // we don't use a transparent bg
// cut trailing spaces
while (len && text [len - 1] == ' ')
{
rxvt_drawable &d2 = d.screen->scratch_drawable (w, h);
- XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h);
+ if (bg < 0 && term->am_pixmap_trans)
+ XCopyArea (disp, term->pixmap, d2, gc, x, y, w, h, 0, 0);
+ else if (bg < 0 && term->bgPixmap.pixmap)
+ {
+ XGCValues gcv;
+
+ gcv.fill_style = FillTiled;
+ gcv.tile = term->pixmap;
+ gcv.ts_x_origin = -x;
+ gcv.ts_y_origin = -y;
+
+ GC gc2 = XCreateGC (disp, d2,
+ GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle,
+ &gcv);
+
+ XFillRectangle (disp, d2, gc2, 0, 0, w, h);
+
+ XFreeGC (disp, gc2);
+ }
+ else
+ XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h);
XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc);
XCopyArea (disp, d2, d, gc, 0, 0, w, h, x, y);
void
rxvt_term::scr_refresh () NOTHROW
{
- unsigned char must_clear, /* use draw_string not draw_image_string */
+ unsigned char have_bg,
showcursor; /* show the cursor */
int16_t col, row, /* column/row we're processing */
ocrow; /* old cursor row */
/*
* A: set up vars
*/
- must_clear = 0;
+ have_bg = 0;
refresh_count = 0;
#if XPM_BACKGROUND
- must_clear |= bgPixmap.pixmap != None;
+ have_bg |= bgPixmap.pixmap != None;
#endif
#if TRANSPARENT
- must_clear |= OPTION (Opt_transparent) && am_transparent;
+ have_bg |= OPTION (Opt_transparent) && am_transparent;
#endif
ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
*/
if (!display->is_local
&& refresh_type == FAST_REFRESH && num_scr_allow && num_scr
- && abs (num_scr) < nrow && !must_clear)
+ && abs (num_scr) < nrow && !have_bg)
{
int16_t nits;
int j;
if (wlen < len)
::swap (wlen, len);
+ XGCValues gcv;
+
+ gcv.graphics_exposures = 1; XChangeGC (dpy, gc, GCGraphicsExposures, &gcv);
XCopyArea (dpy, vt, vt,
gc, 0, Row2Pixel (len + i),
(unsigned int)this->width,
(unsigned int)Height2Pixel (wlen - len + 1),
0, Row2Pixel (len));
+ gcv.graphics_exposures = 0; XChangeGC (dpy, gc, GCGraphicsExposures, &gcv);
+
len = -1;
}
}
if (stp[col] != dtp[col]
|| !RS_SAME (srp[col], drp[col]))
{
- if (must_clear && (i++ > count / 2))
+ if (have_bg && (i++ > count / 2))
break;
dtp[col] = stp[col];
drp[col] = rend;
i = 0;
}
- else if (must_clear || (stp[col] != ' ' && ++i >= 16))
+ else if (have_bg || (stp[col] != ' ' && ++i >= 16))
break;
}
if (back == fore)
font->clear_rect (*drawable, xpixel, ypixel, fwidth * count, fheight, back);
- else if (back == Color_bg)
+ else if (back == Color_bg && have_bg)
{
- if (must_clear)
- {
- CLEAR_CHARS (xpixel, ypixel, count);
-
- for (i = 0; i < count; i++) /* don't draw empty strings */
- if (text[i] != ' ')
- {
- font->draw (*drawable, xpixel, ypixel, text, count, fore, -1);
- break;
- }
- }
- else
- font->draw (*drawable, xpixel, ypixel, text, count, fore, Color_bg);
+ // this is very ugly, maybe push it into ->draw?
+
+ for (i = 0; i < count; i++) /* don't draw empty strings */
+ if (text[i] != ' ')
+ {
+ font->draw (*drawable, xpixel, ypixel, text, count, fore, -1);
+ goto did_clear;
+ }
+
+ CLEAR_CHARS (xpixel, ypixel, count);
+ did_clear: ;
}
else
font->draw (*drawable, xpixel, ypixel, text, count, fore, back);
XSetWindowBackgroundPixmap (dpy, vt, pixmap);
- if (pixmap != None)
- {
- XFreePixmap (dpy, pixmap);
- pixmap = None;
- }
-
XFreeGC (dpy, gc);
am_transparent = 0;
}