Make UI invalidation more deterministic
* src/explorer-events.cpp (hasSelection, startWatchdog, changeSeen): New. * src/mail.cpp (do_parsing): Block invalidation while parsing. * src/windowmessages.cpp (blockInv, unblockInv): New. (delayed_invalidate_ui): Handle block inv state. * src/windowmessages.h: Update accordingly.
UI Invalidation is extremly expensive and often a cause for
crashes. So we should avoid it as much as possible. This
code aims just to do that while still not skipping any
required invalidation.