Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / interface / interface_handlers.c
index aef86e037f85c1c9f9ad3291cfce4aa59abc545e..117483641724420231e8f90c1209ce18b24ce1ef 100644 (file)
@@ -1400,7 +1400,7 @@ static int ui_handler_region_drag_toggle(bContext *C, const wmEvent *event, void
        switch (event->type) {
                case LEFTMOUSE:
                {
-                       if (event->val != KM_PRESS) {
+                       if (event->val == KM_RELEASE) {
                                done = true;
                        }
                        break;
@@ -3607,7 +3607,7 @@ static int ui_do_but_BUT(
                }
        }
        else if (data->state == BUTTON_STATE_WAIT_RELEASE) {
-               if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        if (!(but->flag & UI_SELECT))
                                data->cancel = true;
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -4317,7 +4317,7 @@ static int ui_do_but_NUM(
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        if (data->dragchange) {
 #ifdef USE_DRAG_MULTINUM
                                /* if we started multibutton but didnt drag, then edit */
@@ -4625,7 +4625,7 @@ static int ui_do_but_SLI(
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        if (data->dragchange) {
 #ifdef USE_DRAG_MULTINUM
                                /* if we started multibutton but didnt drag, then edit */
@@ -4778,7 +4778,7 @@ static int ui_do_but_SCROLL(
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                else if (event->type == MOUSEMOVE) {
@@ -4830,7 +4830,7 @@ static int ui_do_but_GRIP(
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                else if (event->type == MOUSEMOVE) {
@@ -5216,7 +5216,7 @@ static int ui_do_but_UNITVEC(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
 
@@ -5550,7 +5550,7 @@ static int ui_do_but_HSVCUBE(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
 
@@ -5828,7 +5828,7 @@ static int ui_do_but_HSVCIRCLE(
                                }
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                return WM_UI_HANDLER_BREAK;
@@ -5918,7 +5918,7 @@ static int ui_do_but_COLORBAND(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                else if (ELEM(event->type, ESCKEY, RIGHTMOUSE)) {
@@ -6169,7 +6169,7 @@ static int ui_do_but_CURVE(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        if (data->dragsel != -1) {
                                CurveMapping *cumap = (CurveMapping *)but->poin;
                                CurveMap *cuma = cumap->cm + cumap->cur;
@@ -6267,7 +6267,7 @@ static int ui_do_but_HISTOGRAM(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                return WM_UI_HANDLER_BREAK;
@@ -6342,7 +6342,7 @@ static int ui_do_but_WAVEFORM(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                return WM_UI_HANDLER_BREAK;
@@ -6426,7 +6426,7 @@ static int ui_do_but_TRACKPREVIEW(
                                        ui_numedit_apply(C, block, but, data);
                        }
                }
-               else if (event->type == LEFTMOUSE && event->val != KM_PRESS) {
+               else if (event->type == LEFTMOUSE && event->val == KM_RELEASE) {
                        button_activate_state(C, but, BUTTON_STATE_EXIT);
                }
                return WM_UI_HANDLER_BREAK;