fix [#35713] Set Origin not waiting for user input.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jun 2013 01:39:07 +0000 (01:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Jun 2013 01:39:07 +0000 (01:39 +0000)
Only activate search-box items on mouse-release,
Otherwise this gives odd behavior when using the operator-search popup since some tools expect the mouse buttons not to be held when activating which includes operators that have their own popup menus.

source/blender/editors/interface/interface_handlers.c

index d431115d84e21678e45cb8a97a0eabd78949dea3..875789c5758daf7ef2ff4ce4c4d01eb7a5ebc957 100644 (file)
@@ -2128,8 +2128,11 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
                                changed = true;
                        }
                        else if (inbox) {
-                               button_activate_state(C, but, BUTTON_STATE_EXIT);
-                               retval = WM_UI_HANDLER_BREAK;
+                               /* if we allow activation on key press, it gives problems launching operators [#35713] */
+                               if (event->val == KM_RELEASE) {
+                                       button_activate_state(C, but, BUTTON_STATE_EXIT);
+                                       retval = WM_UI_HANDLER_BREAK;
+                               }
                        }
                        break;
                }