diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 08:12:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 08:12:43 +0300 |
commit | 10e093b30d17149008a10df3f52d39744577f17b (patch) | |
tree | b52b1c46b8083c45829cebd4c9076e2ab957b70e /source/blender/editors | |
parent | 93412cb4e75d6999d614ea6a47ec82e12f534cc7 (diff) |
Fix T83539: 'activate_init' fails with buttons that have popups
Activating buttons was running too early, before the popup was
positioned on the screen,
causing data-selectors to be positioned incorrectly.
As the early button activation isn't needed, remove this call.
Ensure this doesn't happen again with an assert.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e53dfa83867..5928a622298 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -988,6 +988,11 @@ bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBu */ bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block) { + + /* Running this command before end-block has run, means buttons that open menus + * wont have those menus correctly positioned, see T83539. */ + BLI_assert(block->endblock != 0); + bool done = false; LISTBASE_FOREACH (uiBut *, but, &block->buttons) { if (but->flag & UI_BUT_ACTIVATE_ON_INIT) { |