Without this, on my system, the XI_Motion mouse events were always lagging one event behind (not just one frame, but from whenever was the last time the mouse moved, so the wrong mouse pointer could be kept indefinitely).
i.e., in this gif, whenever I'm moving the mouse back & forth a single pixel, the XI_Motion: logs show the previous position (i.e. moving one pixel right results in it the X coordinate decreasing).
The XQueryPointer values appear to be up-to-date always, however, so this patch switches to using them instead.
This effectively reduces the mouse→display latency by at least 1 frame or 16ms (which, though not the cause for me finding this, is definitely a good benefit!)
Added another commit of updating the mouse position on cursor re-entry into the window (and extracting the code for the mouse processing to a function).
Without this, on my system, the
XI_Motion
mouse events were always lagging one event behind (not just one frame, but from whenever was the last time the mouse moved, so the wrong mouse pointer could be kept indefinitely).i.e., in this gif, whenever I'm moving the mouse back & forth a single pixel, the
XI_Motion:
logs show the previous position (i.e. moving one pixel right results in it the X coordinate decreasing).The
XQueryPointer
values appear to be up-to-date always, however, so this patch switches to using them instead.This effectively reduces the mouse→display latency by at least 1 frame or 16ms (which, though not the cause for me finding this, is definitely a good benefit!)