diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 16:57:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 16:59:50 +0300 |
commit | 5a1a633d0435531c2dabf3442e2a3ca72b4a6da3 (patch) | |
tree | 5960ee200a4565b7194b8e3a5c0b727737c453b0 /source/blender/editors/interface | |
parent | 57de9581e8fa359d11581e6acdfad764d14bd93c (diff) |
UI: minor change to active-default logic
Don't attempt to activate default button if it's already active.
Also expand on the flags comment.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c388ed40851..800b15bff61 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -9242,7 +9242,7 @@ static int ui_handle_menu_event( } else if (ELEM(event->type, RETKEY, PADENTER) && event->val == KM_PRESS) { uiBut *but_active = ui_region_find_first_but_test_flag(ar, UI_BUT_ACTIVE_DEFAULT, UI_HIDDEN); - if (but_active != NULL) { + if ((but_active != NULL) && (but_active->active == NULL)) { ui_handle_button_activate(C, ar, but_active, BUTTON_ACTIVATE); /* Get again below just incase it's disabled for eg. */ } |