From 601b0b284e1ec87917c47341165c111ef5b8d96c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 8 Dec 2011 20:24:01 +0000 Subject: [PATCH] Fix for #29475 broke properly updating toggle buttons in popup menus. Tweak the fix a bit, not a true solution to the problem, but too close to release for bigger changes. --- .../blender/editors/interface/interface_handlers.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c6159487145..aee23626787 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5241,11 +5241,14 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s data->state= state; - if(!ELEM(state, BUTTON_STATE_EXIT, BUTTON_STATE_HIGHLIGHT)) { - /* When objects for eg. are removed, running ui_check_but() - * can access the removed data - so disable update on exit - * or highlight */ - ui_check_but(but); + if(state != BUTTON_STATE_EXIT) { + /* When objects for eg. are removed, running ui_check_but() can access + the removed data - so disable update on exit. Also in case of + highlight when not in a popup menu, we remove because data used in + button below popup might have been removed by action of popup. Needs + a more reliable solution... */ + if(state != BUTTON_STATE_HIGHLIGHT || but->block->handle) + ui_check_but(but); } /* redraw */