diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-02-19 18:41:19 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-19 20:43:32 +0300 |
commit | 81aa2a93e98951df154f57d7d6591f4e623e8c06 (patch) | |
tree | b02447a558786f5a78f0ce0583b49004bc0c1b19 /source/blender/editors | |
parent | df8bd07313b52a69b17fbd0dc1f84637264e86ed (diff) |
Fix T61274: duplicate current workspace makes the workspace menu disappear.
Differential Revision: https://developer.blender.org/D4321
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index db170ec2a9f..64e05c0c750 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3919,8 +3919,10 @@ static bool ui_but_is_mouse_over_icon_extra(const ARegion *region, uiBut *but, c static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButtonData *data, const wmEvent *event) { + const bool is_property = (but->rnaprop != NULL); + #ifdef USE_DRAG_TOGGLE - { + if (is_property) { int retval; if (ui_do_but_ANY_drag_toggle(C, but, data, event, &retval)) { return retval; @@ -3931,7 +3933,7 @@ static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButton if (data->state == BUTTON_STATE_HIGHLIGHT) { const int rna_type = but->rnaprop ? RNA_property_type(but->rnaprop) : 0; - if (but->rnaprop && + if (is_property && ELEM(rna_type, PROP_POINTER, PROP_STRING) && (but->custom_data != NULL) && (event->type == LEFTMOUSE) && @@ -3940,9 +3942,12 @@ static int ui_do_but_TAB(bContext *C, uiBlock *block, uiBut *but, uiHandleButton button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); return WM_UI_HANDLER_BREAK; } - else if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY) && (event->val == KM_PRESS)) { - button_activate_state(C, but, BUTTON_STATE_EXIT); - return WM_UI_HANDLER_BREAK; + else if (ELEM(event->type, LEFTMOUSE, PADENTER, RETKEY)) { + int event_val = (is_property) ? KM_PRESS : KM_CLICK; + if (event->val == event_val) { + button_activate_state(C, but, BUTTON_STATE_EXIT); + return WM_UI_HANDLER_BREAK; + } } } else if (data->state == BUTTON_STATE_TEXT_EDITING) { |