diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-21 09:49:53 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-21 10:20:44 +0300 |
commit | fb8757869871872a1c1bb66bb45e59c780539c74 (patch) | |
tree | 42d573468bb21cd932ca7ed04dfa78ffd03466a7 /source/blender/editors/interface/interface_handlers.c | |
parent | c4ce1b70e398785e372546daea7a33347e6767f7 (diff) |
Fix T96255: Node socket fails to drag
This is a general issue exposed by moving from tweak to click-drag
events [0], however this bug would have existed for both click &
click-drag events beforehand.
Since [1] the following behavior could occur:
- Click-drag the cursor away from the button.
- Leaving the button would flag it as disabled.
- The disabled button would then break
causing the event to be considered handled.
- Once handled no click / click-drag action would be tested.
The bug would only happen if the cursor left the button before the drag
threshold was reached which tended to happen with an UI-scale 2 or more.
Or with an increased drag threshold.
Revert [1] (fix for T78503), which is no longer needed since as of [2].
[0]: 4986f718482b061082936f1f6aa13929741093a2
[1]: 6f96dd85766a8159d5ffb761cbb4dbd20b7cad00
[2]: 87c13ac68c477486adecd8d548a016309fc2b54d
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8677b1ed78a..8935df7b581 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7969,7 +7969,16 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } if (but->flag & UI_BUT_DISABLED) { - return WM_UI_HANDLER_BREAK; + /* It's important to continue here instead of breaking since breaking causes the event to be + * considered "handled", preventing further click/drag events from being generated. + * + * An example of where this is needed is dragging node-sockets, where dragging a node-socket + * could exit the button before the drag threshold was reached, disable the button then break + * handling of the #MOUSEMOVE event preventing the socket being dragged entirely, see: T96255. + * + * Region level event handling is responsible for preventing events being passed + * through to parts of the UI that are logically behind this button, see: T92364. */ + return WM_UI_HANDLER_CONTINUE; } switch (but->type) { |