From ed99c94bef1dc896a645d5b361964afa7372365b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Mar 2013 06:36:09 +0000 Subject: fix [#34636] bpy.app.handlers.load_post not run on startup file loading after splashscreen --- source/blender/windowmanager/intern/wm_init_exit.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager/intern/wm_init_exit.c') diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 532404cf218..67b0f920662 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -47,6 +47,7 @@ #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" +#include "BLI_callbacks.h" #include "BLI_listbase.h" #include "BLI_path_util.h" #include "BLI_string.h" @@ -220,8 +221,17 @@ void WM_init(bContext *C, int argc, const char **argv) #endif /* load last session, uses regular file reading so it has to be in end (after init py etc) */ - if (U.uiflag2 & USER_KEEP_SESSION) + if (U.uiflag2 & USER_KEEP_SESSION) { wm_recover_last_session(C, NULL); + } + else { + /* normally 'wm_homefile_read' will do this, + * however python is not initialized when called from this function. + * + * unlikey any handlers are set but its possible, + * note that recovering the last session does its own callbacks callbacks. */ + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + } } void WM_init_splash(bContext *C) -- cgit v1.2.3