xdrawcursor keeps track of when the cursor is needed to be updated, so
better to just update cursor position alongside rather than in draw.
---
 st.c | 1 -
 x.c  | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/st.c b/st.c
index 3e48410..06f267e 100644
--- a/st.c
+++ b/st.c
@@ -2588,7 +2588,6 @@ draw(void)
                        term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
        term.ocx = cx, term.ocy = term.c.y;
        xfinishdraw();
-       xximspot(term.ocx, term.ocy);
 }
 
 void
diff --git a/x.c b/x.c
index 13194c6..00d0062 100644
--- a/x.c
+++ b/x.c
@@ -1511,6 +1511,9 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, 
Glyph og)
                                        cursorthickness, win.ch);
                        break;
                }
+
+               /* Update xim cursor position */
+               xximspot(cx, cy);
        } else {
                XftDrawRect(xw.draw, &drawcol,
                                borderpx + cx * win.cw,
-- 
2.25.0


Reply via email to