diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-12-12 16:50:49 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-12-12 16:50:49 +0400 |
commit | 0ca46e3524ad74b4912b4cdfa8f27ae162e10257 (patch) | |
tree | 0c17c734cdf1d61a8e6672f9449620c6410e5e31 /source | |
parent | ee62b20158f2322006b1b186024d888ec2175faf (diff) |
Fix for menu context. The menu draw function context did not inherit the custom context storage from the original uiLayout yet. Fix by Campbell Barton (ideasman_42).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 9759c22f30e..c67c64a0540 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1466,7 +1466,13 @@ static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt) printf("%s: opening menu \"%s\"\n", __func__, mt->idname); } + if (layout->context) + CTX_store_set(C, layout->context); + mt->draw(C, &menu); + + if (layout->context) + CTX_store_set(C, NULL); } static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN, const char *tip) |