From ae97f681fca0b39b27f6148925ce055be438467d Mon Sep 17 00:00:00 2001 From: bakkeby Date: Mon, 20 Apr 2020 10:55:37 +0200 Subject: [PATCH] Update XIM cursor position only if changed Updating XIM cursor position is expensive, so only update it when cursor position changed. --- st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index f26d0b9..968df45 100644 --- a/st.c +++ b/st.c @@ -2731,6 +2731,7 @@ void drawregion(int x1, int y1, int x2, int y2) { int y; + for (y = y1; y < y2; y++) { if (!term.dirty[y]) continue; @@ -2767,7 +2768,8 @@ draw(void) #endif // SCROLLBACK_PATCH xdrawcursor(cx, term.c.y, term.line[term.c.y][cx], term.ocx, term.ocy, term.line[term.ocy][term.ocx]); - term.ocx = cx, term.ocy = term.c.y; + term.ocx = cx; + term.ocy = term.c.y; xfinishdraw(); if (ocx != term.ocx || ocy != term.ocy) xximspot(term.ocx, term.ocy);