Also, in HandleConfigureNotifyEvent we have a loop that consumes all outstanding ConfigureNotify events (which is/was an optimization for window resizing where we get lots of ConfigureNotify events while the user is still resizing the window). Only the latest event will be checked for a new window position. But if the last event is NOT a synthetic one (send_event is 0) we completely miss storing any position changes.
According to ICCCM ConfigureNotify events need special treatment reagrding window position, see https://tronche.com/gui/x/icccm/sec-4.html#WM_NORMAL_HINTS
Our code does not apply this special treatment.
Also, in HandleConfigureNotifyEvent we have a loop that consumes all outstanding ConfigureNotify events (which is/was an optimization for window resizing where we get lots of ConfigureNotify events while the user is still resizing the window). Only the latest event will be checked for a new window position. But if the last event is NOT a synthetic one (send_event is 0) we completely miss storing any position changes.