Update XIM cursor position only if changed

Updating XIM cursor position is expensive, so only update it when cursor
position changed.
This commit is contained in:
bakkeby 2020-04-20 10:55:37 +02:00
parent 60d1827504
commit ae97f681fc
1 changed files with 3 additions and 1 deletions

4
st.c
View File

@ -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);