mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
[st][PATCH] 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:
parent
f7b0d77a03
commit
2465559051
3
st.c
3
st.c
@ -2735,7 +2735,7 @@ drawregion(int x1, int y1, int x2, int y2)
|
|||||||
void
|
void
|
||||||
draw(void)
|
draw(void)
|
||||||
{
|
{
|
||||||
int cx = term.c.x;
|
int cx = term.c.x, ocx = term.ocx, ocy = term.ocy;
|
||||||
|
|
||||||
if (!xstartdraw())
|
if (!xstartdraw())
|
||||||
return;
|
return;
|
||||||
@ -2757,6 +2757,7 @@ draw(void)
|
|||||||
term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
|
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();
|
xfinishdraw();
|
||||||
|
if (ocx != term.ocx || ocy != term.ocy)
|
||||||
xximspot(term.ocx, term.ocy);
|
xximspot(term.ocx, term.ocy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user