This is also a problem with seemingly stationary UIs, where a button is only shown when the pointer gets close to it. Especially when that button is within a clickable area, such as a thumbnail image.
The ideal solution to all of these would be for the UI to keep track of drawing events and disable any click that occurs in proximity to a just-redrawn area, and beep instead.