Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-25 13:26:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-25 13:26:52 +0300
commit16377abda8adb6444e888d1144d9225fa6415e65 (patch)
tree27a46c7ee5765aefa2f60346a3074e6608ffc6e0 /source/blender/windowmanager/intern/wm.c
parent2d5935a9c095fc8abae844571e72923027c40725 (diff)
WM: initialize WM and deps before handling events
This avoids obscure bugs where operators could run from events that happen before the UI and depsgraph have been initialized. See: D2809 for details.
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r--source/blender/windowmanager/intern/wm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 1738dabde2d..a09cc4aeb31 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -495,6 +495,10 @@ void wm_close_and_free_all(bContext *C, ListBase *wmlist)
void WM_main(bContext *C)
{
+ /* Single refresh before handling events.
+ * This ensures we don't run operators before the depsgraph has been evaluated. */
+ wm_event_do_refresh_wm_and_depsgraph(C);
+
while (1) {
/* get events from ghost, handle window events, add to window queues */