diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-06 22:56:54 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-06 22:56:54 +0300 |
commit | bd335f13fe3d25e8e6bb472acb9c727d1629e582 (patch) | |
tree | dc7c006b774a3f0727d4fc5574222c37e476f1ca /source/blender/editors/interface/interface_templates.c | |
parent | 8c2cec937bab7ace568bf5cd1448cd8632406883 (diff) |
Fix T47657: Using template_list() with invoke_props_dialog()
popups have no wm_region in context, using wm_menu here.
Not working perfect, but at least it prevents crash.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index a47d60812b4..a3b04e1c9bc 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2947,7 +2947,11 @@ void uiTemplateList( /* We tag the list id with the list type... */ BLI_snprintf(ui_list_id, sizeof(ui_list_id), "%s_%s", ui_list_type->idname, list_id ? list_id : ""); - ar = CTX_wm_region(C); + /* Allows to work in popups. */ + ar = CTX_wm_menu(C); + if (ar == NULL) { + ar = CTX_wm_region(C); + } ui_list = BLI_findstring(&ar->ui_lists, ui_list_id, offsetof(uiList, list_id)); if (!ui_list) { |