Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-27 20:30:25 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-28 11:42:58 +0300
commita14005c070a1f3b7a1ed2013c61a359e816734fa (patch)
tree749c42f9758f916de83fc94313fe9c49c06b2731 /source/blender/editors/interface/interface_region_popup.c
parenta593cc046c330ca07401cf04569a13b6864e670a (diff)
UI: fix popover menus not refreshing when changing settings.
Diffstat (limited to 'source/blender/editors/interface/interface_region_popup.c')
-rw-r--r--source/blender/editors/interface/interface_region_popup.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 56611627a67..94e6aa44811 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -314,9 +314,11 @@ static void ui_block_region_refresh(const bContext *C, ARegion *ar)
ar->do_draw &= ~RGN_DRAW_REFRESH_UI;
for (block = ar->uiblocks.first; block; block = block_next) {
block_next = block->next;
- if (block->handle->can_refresh) {
- handle_ctx_area = block->handle->ctx_area;
- handle_ctx_region = block->handle->ctx_region;
+ uiPopupBlockHandle *handle = block->handle;
+
+ if (handle->can_refresh) {
+ handle_ctx_area = handle->ctx_area;
+ handle_ctx_region = handle->ctx_region;
if (handle_ctx_area) {
CTX_wm_area_set((bContext *)C, handle_ctx_area);
@@ -324,7 +326,10 @@ static void ui_block_region_refresh(const bContext *C, ARegion *ar)
if (handle_ctx_region) {
CTX_wm_region_set((bContext *)C, handle_ctx_region);
}
- ui_popup_block_refresh((bContext *)C, block->handle, NULL, NULL);
+
+ uiBut *but = handle->popup_create_vars.but;
+ ARegion *butregion = handle->popup_create_vars.butregion;
+ ui_popup_block_refresh((bContext *)C, handle, butregion, but);
}
}
}
@@ -654,6 +659,7 @@ uiPopupBlockHandle *ui_popup_block_create(
handle->popup_create_vars.create_func = create_func;
handle->popup_create_vars.handle_create_func = handle_create_func;
handle->popup_create_vars.arg = arg;
+ handle->popup_create_vars.but = but;
handle->popup_create_vars.butregion = but ? butregion : NULL;
copy_v2_v2_int(handle->popup_create_vars.event_xy, &window->eventstate->x);
/* caller may free vars used to create this popup, in that case this variable should be disabled. */
@@ -684,6 +690,10 @@ uiPopupBlockHandle *ui_popup_block_create(
void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
{
+ if (handle->popup_create_vars.free_func) {
+ handle->popup_create_vars.free_func(handle, handle->popup_create_vars.arg);
+ }
+
ui_popup_block_remove(C, handle);
MEM_freeN(handle);