aboutsummaryrefslogtreecommitdiffstats
path: root/src/window-xlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window-xlib.c')
-rw-r--r--src/window-xlib.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c
index 9b97c43..375e595 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -528,21 +528,26 @@ static void runes_window_backend_audible_bell(RunesTerm *t)
static void runes_window_backend_draw_cursor(RunesTerm *t)
{
if (!t->scr.hide_cursor) {
+ int row = t->scr.cur.row, col = t->scr.cur.col;
+
+ if (col >= t->scr.max.col) {
+ col = t->scr.max.col - 1;
+ }
+
cairo_save(t->backend_cr);
cairo_set_source(t->backend_cr, t->cursorcolor);
if (t->unfocused) {
cairo_set_line_width(t->backend_cr, 1);
cairo_rectangle(
t->backend_cr,
- t->scr.cur.col * t->fontx + 0.5,
- t->scr.cur.row * t->fonty + 0.5,
+ col * t->fontx + 0.5, row * t->fonty + 0.5,
t->fontx, t->fonty);
cairo_stroke(t->backend_cr);
}
else {
cairo_rectangle(
t->backend_cr,
- t->scr.cur.col * t->fontx, t->scr.cur.row * t->fonty,
+ col * t->fontx, row * t->fonty,
t->fontx, t->fonty);
cairo_fill(t->backend_cr);
}