From 90ec634135a0a79534fc34146c4860805279a3a9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Mar 2022 21:33:16 +1100 Subject: Fix incorrect drag-event threshold when releasing modifiers early db4313610cab18933c1b1b1348720ea241b9d91e added support for modifier keys to be released while dragging. The key release events set wmEvent.prev_type which is used select the drag threshold, causing the wrong threshold to be used. Add wmEvent.prev_click_type which is only set when the drag begins. --- source/blender/windowmanager/WM_types.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source/blender/windowmanager/WM_types.h') diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index cdbaa2739ba..26462402e3d 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -636,6 +636,15 @@ typedef struct wmEvent { short prev_type; /** The previous value of `val`. */ short prev_val; + /** + * The previous value of #wmEvent.xy, + * Unlike other previous state variables, this is set on any mouse motion. + * Use `prev_click` for the value at time of pressing. + */ + int prev_xy[2]; + + /** The `type` at the point of the click action. */ + short prev_click_type; /** The time when the key is pressed, see #PIL_check_seconds_timer. */ double prev_click_time; /** The location when the key is pressed (used to enforce drag thresholds). */ @@ -645,13 +654,6 @@ typedef struct wmEvent { /** The `keymodifier` at the point of the click action. */ short prev_click_keymodifier; - /** - * The previous value of #wmEvent.xy, - * Unlike other previous state variables, this is set on any mouse motion. - * Use `prev_click` for the value at time of pressing. - */ - int prev_xy[2]; - /** * Modifier states. * #KM_SHIFT, #KM_CTRL, #KM_ALT & #KM_OSKEY is apple or windows-key. -- cgit v1.2.3