Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-01 13:33:16 +0300
committerCampbell Barton <campbell@blender.org>2022-03-01 13:41:08 +0300
commit90ec634135a0a79534fc34146c4860805279a3a9 (patch)
tree872b12d9b4adc5d70de4734cae41f167a6480305 /source/blender/windowmanager/WM_types.h
parent4b9c77a19aa359b5ab4b86e05cff1c8627d05a1e (diff)
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.
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r--source/blender/windowmanager/WM_types.h16
1 files changed, 9 insertions, 7 deletions
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). */
@@ -646,13 +655,6 @@ typedef struct wmEvent {
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.
*/