I don't understand how event handling works, so I am
> wondering: can we indeed be sure that window resize etc
> events are being blocked inside the freeze/thaw block in
> Axes.draw()? Are they blocked inside the entire draw
> method? What controls when a mouse event gets processed?
As far as I understand, GTK and other GUIs operate in a single thread,
which means all the events they generate will be handled sequentially
and not in parallel. Thus we can be sure that a call to draw will
complete before the next one is called. But someone correct me if I'm
What we try to avoid is having too many of these events pile up, so
for example if a draw operation is expensive, lots of them can be
queued and will be executing long after the resize is over. To avoid
this, we use an idle draw handler in FigureCanvas.draw_idle.