diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 03:42:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-15 03:42:07 +0300 |
commit | 745311ed4c9ebdc410b60e558832ab22cb9106de (patch) | |
tree | 2c92b43d3e5562640da096ffbaceb4e7ea724db4 /source/blender/editors | |
parent | b5a860c9cc023d5aa8708e06e33efa2229dd5047 (diff) |
Fix T60506: Menu toggle clicks pass through to area
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f649cfb04e2..e037692e3e8 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4021,7 +4021,23 @@ static int ui_do_but_TOG( #endif if (data->state == BUTTON_STATE_HIGHLIGHT) { - if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val == KM_PRESS) { + bool do_activate = false; + if (ELEM(event->type, PADENTER, RETKEY)) { + if (event->val == KM_PRESS) { + do_activate = true; + } + } + else if (event->type == LEFTMOUSE) { + if (ui_block_is_menu(but->block)) { + /* Behave like other menu items. */ + do_activate = (event->val == KM_RELEASE); + } + else { + do_activate = (event->val == KM_PRESS); + } + } + + if (do_activate) { #if 0 /* UNUSED */ data->togdual = event->ctrl; data->togonly = !event->shift; |