Fix T55301: Transform confirm on release fails w/ MMB
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 06:48:21 +0000 (08:48 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Jun 2018 06:48:21 +0000 (08:48 +0200)
source/blender/editors/transform/transform.c

index 69e8ebf5ca45eb8ba3ac64aabbbf5323df4e959d..ac9b2f2900c88591fa6d624a5e291f2aba9a9d33 100644 (file)
@@ -1504,7 +1504,7 @@ int transformEvent(TransInfo *t, const wmEvent *event)
                /* confirm transform if launch key is released after mouse move */
                if (t->flag & T_RELEASE_CONFIRM) {
                        /* XXX Keyrepeat bug in Xorg messes this up, will test when fixed */
                /* confirm transform if launch key is released after mouse move */
                if (t->flag & T_RELEASE_CONFIRM) {
                        /* XXX Keyrepeat bug in Xorg messes this up, will test when fixed */
-                       if (event->type == t->launch_event && (t->launch_event == LEFTMOUSE || t->launch_event == RIGHTMOUSE)) {
+                       if ((event->type == t->launch_event) && ISMOUSE(t->launch_event)) {
                                t->state = TRANS_CONFIRM;
                        }
                }
                                t->state = TRANS_CONFIRM;
                        }
                }
@@ -2066,14 +2066,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 
        t->mode = mode;
 
 
        t->mode = mode;
 
-       t->launch_event = event ? event->type : -1;
-
-       if (t->launch_event == EVT_TWEAK_R) {
-               t->launch_event = RIGHTMOUSE;
-       }
-       else if (t->launch_event == EVT_TWEAK_L) {
-               t->launch_event = LEFTMOUSE;
-       }
+       /* Needed to translate tweak events to mouse buttons. */
+       t->launch_event = event ? WM_userdef_event_type_from_keymap_type(event->type) : -1;
 
        // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0)
        // For manipulator only, so assume LEFTMOUSE
 
        // XXX Remove this when wm_operator_call_internal doesn't use window->eventstate (which can have type = 0)
        // For manipulator only, so assume LEFTMOUSE