[Bf-blender-cvs] [099dd0690ce] master: Fix T76481: Fast clicks over Dopesheet toggles trigger renaming

Julian Eisel noreply at git.blender.org
Wed May 13 11:51:57 CEST 2020


Commit: 099dd0690ced05c38819861b3dca84e03ccdb3c1
Author: Julian Eisel
Date:   Wed May 13 11:45:28 2020 +0200
Branches: master
https://developer.blender.org/rB099dd0690ced05c38819861b3dca84e03ccdb3c1

Fix T76481: Fast clicks over Dopesheet toggles trigger renaming

Making this work reliably on the event system side is difficult. So
instead, let the toggle icons take and swallow double-click events on
the UI handler level.

The second change in this patch seems to be only needed for touchpads.
Without it, renaming would still be triggered sometimes, because the
hovered button wasn't re-activated fast enough.

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

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 ccb4bbbd116..ebde1d54c07 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4446,7 +4446,8 @@ static int ui_do_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data, cons
         do_activate = (event->val == KM_RELEASE);
       }
       else {
-        do_activate = (event->val == KM_PRESS);
+        /* Also use double-clicks to prevent fast clicks to leak to other handlers (T76481). */
+        do_activate = ELEM(event->val, KM_PRESS, KM_DBL_CLICK);
       }
     }
 
@@ -8874,7 +8875,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
        * This is needed to make sure if a button was active,
        * it stays active while the mouse is over it.
        * This avoids adding mousemoves, see: [#33466] */
-      if (ELEM(state_orig, BUTTON_STATE_INIT, BUTTON_STATE_HIGHLIGHT)) {
+      if (ELEM(state_orig, BUTTON_STATE_INIT, BUTTON_STATE_HIGHLIGHT, BUTTON_STATE_WAIT_DRAG)) {
         if (ui_but_find_mouse_over(region, event) == but) {
           button_activate_init(C, region, but, BUTTON_ACTIVATE_OVER);
         }



More information about the Bf-blender-cvs mailing list