commit ae97f681fca0b39b27f6148925ce055be438467d
parent 60d1827504f11324d26707e0ff3bdf42de1380cb
Author: bakkeby <bakkeby@gmail.com>
Date: Mon, 20 Apr 2020 10:55:37 +0200
Update XIM cursor position only if changed
Updating XIM cursor position is expensive, so only update it when cursor
position changed.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git 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);