diff options
author | Julian Eisel <julian@blender.org> | 2020-08-05 20:41:04 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-08-05 20:41:04 +0300 |
commit | d9b72a96b3683dd3fb7c616f880ff8120179ed68 (patch) | |
tree | 502a45697dec4cc9731313f526d90528ee9b89ab /source/blender/editors/interface | |
parent | 93f4f9681846926a4dcaf6e11d4d93dc69eb30ad (diff) | |
parent | 1b593edf1d898144ee591de0fbd3d1351d16d730 (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5dfecacf81b..c5d5fbb90c0 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -892,6 +892,12 @@ bool UI_but_active_only_ex( } } if ((activate == true) || (found == false)) { + /* There might still be another active button. */ + uiBut *old_active = ui_region_find_active_but(region); + if (old_active) { + ui_but_active_free(C, old_active); + } + ui_but_activate_event((bContext *)C, region, but); } else if ((found == true) && (isactive == false)) { diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index dc119d19003..efbfcf8d19d 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8001,6 +8001,9 @@ static void button_activate_init(bContext *C, { uiHandleButtonData *data; + /* Only ever one active button! */ + BLI_assert(ui_region_find_active_but(region) == NULL); + /* setup struct */ data = MEM_callocN(sizeof(uiHandleButtonData), "uiHandleButtonData"); data->wm = CTX_wm_manager(C); |