Fix for menu context. The menu draw function context did not inherit the custom conte...
authorLukas Toenne <lukas.toenne@googlemail.com>
Wed, 12 Dec 2012 12:50:49 +0000 (12:50 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Wed, 12 Dec 2012 12:50:49 +0000 (12:50 +0000)
source/blender/editors/interface/interface_layout.c

index 9759c22f30efe611cba2965729fc8654c7b55154..c67c64a0540bdff9ac4f565e5cef45def5190b2d 100644 (file)
@@ -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)