Rein Klazes wijn@wanadoo.nl writes:
As soon as I move the window to which I am calling SetDIBitsToDevice partly outside of the screen, the drawable lies partly outside the screen rectangle and XGetSubImage fails -> crash. Clipping to the screen rectangle helps somewhat for very slow moves, but with faster moves I still get those failures.
What am I doing wrong here?
Nothing, there's no way to avoid the race. You just need to ignore the BadMatch error in that case.