This commit introduces a new `WM_event_handling_break` API, that allows
some code executed during event handling (e.g. operators etc.) to
request the `WM_main` main event loop to stop processing the event
queues and to do a full loop (including redraw step) before resuming
handling of the events.
`test_undo.py` undo tests had to be modified to add a small delay when
batch-triggering undo/redo events, to give Blender enough time to
process all the relevant events and reach the expected state.
Co-authored-by: Campbell Barton <ideasman42@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/156375
After creating a new scene in a separate window when performing UI
tests, the respective view layer for the window may not be updated
immediately in the event loop.
Previously, this was mitigated with a single `yield` statement that
would delay processing by a single tick. To fix this issue, this commit
adds the capability to yield for a specific `timedelta` and waits this
amount of time for the two affected tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/136012