Commit: 81aa2a93e98951df154f57d7d6591f4e623e8c06
Author: Philipp Oeser
Date:   Tue Feb 19 16:41:19 2019 +0100
Branches: master
https://developer.blender.org/rB81aa2a93e98951df154f57d7d6591f4e623e8c06

Fix T61274: duplicate current workspace makes the workspace menu disappear.

Differential Revision: https://developer.blender.org/D4321

===================================================================

M       source/blender/editors/interface/interface_handlers.c

===================================================================

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) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to