diff options
author | Luca Rood <dev@lucarood.com> | 2022-08-18 16:26:30 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2022-08-18 16:26:30 +0300 |
commit | 9a65dca37c90077bb61d1545dea1ef9b1f39758e (patch) | |
tree | 4b850d730a5ebc0914dddde9e5b10cf43a845bfb /source | |
parent | a7652bf2f7fb4f2b6c991f7596fa2b4d240f6068 (diff) | |
parent | 8a799b00f8fa28433ba44cfec09757f77a46ae0d (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 16d228708eb..7ed9488950e 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -1230,7 +1230,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev } } - MenuType *mt = WM_menutype_find("WM_MT_button_context", true); + MenuType *mt = WM_menutype_find("UI_MT_button_context_menu", true); if (mt) { UI_menutype_draw(C, mt, uiLayoutColumn(layout, false)); } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 3465373c85d..94d17ed3c88 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -3028,7 +3028,14 @@ void uiItemMContents(uiLayout *layout, const char *menuname) if (WM_menutype_poll(C, mt) == false) { return; } + + bContextStore *previous_ctx = CTX_store_get(C); UI_menutype_draw(C, mt, layout); + + /* Restore context that was cleared by `UI_menutype_draw`. */ + if (layout->context) { + CTX_store_set(C, previous_ctx); + } } void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index) |