[Bf-blender-cvs] [e7476b667e9] master: Fix T67756: File drag starts on file browser open

Julian Eisel noreply at git.blender.org
Sun Sep 8 17:05:57 CEST 2019


Commit: e7476b667e9ea94ae70792a39477472758045fd6
Author: Julian Eisel
Date:   Sun Sep 8 16:53:24 2019 +0200
Branches: master
https://developer.blender.org/rBe7476b667e9ea94ae70792a39477472758045fd6

Fix T67756: File drag starts on file browser open

When the file browser was opened (from a temporary window since the file
browser redesign) using a button in the UI, under certain conditions
moving the mouse would trigger files to be dragged.

Note that this has been an issue before the new file browser design was
introduced, although under slightly different conditions.

Steps to reproduce:
* With factory settings, press F12
* Open a different image in the appearing Image Editor (not Render
  Result)
* Make sure the window is not maximized
* Press N to open the side bar, open Image tab
* Click the folder icon there to change the image
* Change to thumbnail display type in the appearing file browser
* Cancel, click the folder icon again
Moving the mouse now would start dragging files in most cases.

The same issue could be reproduced in a similar way when installing
lights/MatCaps or HDRIs through Preferences -> Lights -> Install...

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

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 670397a7b8a..9a16cc6d41f 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4299,7 +4299,7 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con
   if (data->state == BUTTON_STATE_HIGHLIGHT) {
 
     /* first handle click on icondrag type button */
-    if (event->type == LEFTMOUSE && but->dragpoin) {
+    if ((event->type == LEFTMOUSE) && (event->val == KM_PRESS) && but->dragpoin) {
       if (ui_but_contains_point_px_icon(but, data->region, event)) {
 
         /* tell the button to wait and keep checking further events to
@@ -4311,7 +4311,7 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con
       }
     }
 #ifdef USE_DRAG_TOGGLE
-    if (event->type == LEFTMOUSE && ui_but_is_drag_toggle(but)) {
+    if ((event->type == LEFTMOUSE) && (event->val == KM_PRESS) && ui_but_is_drag_toggle(but)) {
       button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG);
       data->dragstartx = event->x;
       data->dragstarty = event->y;



More information about the Bf-blender-cvs mailing list