https://en.wikipedia.org/wiki/Box-drawing_character
- Overwrite/clear selections before freeing them
- ≣ † ☆ ツ ⌘›🍺∴ ( ͡° ͜ʖ ͡°) ƒ ︵ ₂ 😈 θ ƒ › ʼ ƒ ∂ ʻ μ › ∫ ◇ ♪
- ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ
+ ► ə β ə ſ ρ ə ∴ ♪ 😱 † 😳 › ▛ ᵗ *
- Verify if dead key support is incomplete for ISO-8859-4 and ISO-8859-10.
There were special characters that were unicode since the start but also
could have punctuation. And others that used two at a time... It might
- Smooth scrolling could theoretically work with scroll regions instead of
only working when scrolling from the bottom of the screen. The current
implementation could also be improved and more configurable. Notably, the
- top line is not scrolled and an extra memory buffer is allocated for
- simplicity. Also look at tcflow(3). Currently, for smooth scrolling to
- work with screen(1)/tmux(1), the status bar must be disabled or configured
- to be at the top.
+ top line is not scrolled. Also look at tcflow(3). Currently, for smooth
+ scrolling to work with screen(1)/tmux(1), the status bar must be disabled or
+ configured to be at the top.
An early test used input flow control by temporarily stopping to read. This
was not kept, but it may be necessary in some circumstances to avoid sudden
- jumps. Was restored in a different way, may need improvement.
+ jumps. Was restored in a different way, may need improvement. It could
+ still be improved to more accurately detect when extra scrolling would
+ occur. Long jump may also be considered.
- Check termios(4) IMAXBEL and queue size, also reported by stty(1).
This may allow to tweak interactive performance when a lot of application
output happens.
/*
* XXX
- * Smooth scrolling version. Instead of stopping at the required
- * scanline, this implementation expects an extra line in bitmap
- * memory that extends the visible window. Not ideal but easy without
- * affecting performance. It also does not handle properly the top
- * line that is to be discarded, which gets overwritten bottom-up
+ * Smooth scrolling version. Currently does not handle properly the
+ * top line that is to be discarded, which gets overwritten bottom-up
* rather than scrolled. It is not very noticeable but still
- * considered to be a bug. It will be visible at low refresh rates.
+ * considered to be a bug of the implementation. It is visible at low
+ * refresh rates.
*/
sc->update_y = ((low * (FONT_HEIGHT + cfg_leading)) +
st->smoothscroll_offset) * 2;
}
/*
+ * Stop if we reach the bottom of the pixels memory, possible
+ * with a smooth scrolling offset.
+ */
+ if (scanptr2 >= sc->pixels_boundary)
+ break;
+
+ /*
* Draw pixel or background.
* p serves as a boolean as well as an intensity level from 1
* to INTENSITY_MAX. If 0/false, the background will be drawn.
s->visual = s->vinfo.visual;
depth = s->vinfo.depth;
- /*
- * XXX
- * We allocate an extra line for use by the optional smooth scrolling
- * feature, that exists in the underlaying ZPixmap although the X
- * window size is kept smaller. See draw.c for more related notes.
- */
-
/* Font rendered with 2x/1.5x software zoom */
if (cfg_condensed)
width = ((int)((cfg_text_width * FONT_WIDTH) * 1.5)) + 1;
else
width = ((cfg_text_width * FONT_WIDTH) * 2) + 1;
#ifdef EXPAND_Y
- height = ((int)(((cfg_text_height + 1) * (FONT_HEIGHT + cfg_leading))
- * 2.5) + 1);
+ height = ((int)((cfg_text_height * (FONT_HEIGHT + cfg_leading)) * 2.5)
+ + 1);
#else
- height = ((cfg_text_height + 1) * (FONT_HEIGHT + cfg_leading)) * 2;
+ height = (cfg_text_height * (FONT_HEIGHT + cfg_leading)) * 2;
#endif
s->pixels_width = width;
if ((s->pixels = malloc((width * height) * sizeof(uint32_t)))
== NULL)
goto err;
+ s->pixels_boundary = &s->pixels[width * height];
- s->win = XCreateWindow(s->dpy, s->parentwin, 0, 22, width,
- height - ((FONT_HEIGHT + cfg_leading) * 2), 0,
+ s->win = XCreateWindow(s->dpy, s->parentwin, 0, 22, width, height, 0,
depth, InputOutput, s->visual,
/*CWBackPixel | CWColormap | CWBorderPixel*/0, &s->attr);
if (s->image->bytes_per_line == width * 4) {
free(s->pixels);
s->pixels = (uint32_t *)s->image->data;
+ s->pixels_boundary = &s->pixels[width * height];
s->shm = true;
} else
destroy_xshm_image(s->dpy, s->image, &s->shm_info);
#endif
bool shm;
/* What we work with */
- uint32_t *pixels;
+ uint32_t *pixels, *pixels_boundary;
int pixels_width, pixels_height;
int update_x, update_y, update_w, update_h;
int fd;