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.
This commit is contained in:
Brecht Van Lommel 2011-12-08 20:24:01 +00:00
parent 7c630aac80
commit 601b0b284e

@ -5241,10 +5241,13 @@ 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 */
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);
}