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/intern/wm_event_query.c
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/intern/wm_event_query.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index 0d42d0a44c7..5e8b9b945c9 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -260,8 +260,8 @@ bool WM_cursor_test_motion_and_update(const int mval[2])
int WM_event_drag_threshold(const struct wmEvent *event)
{
int drag_threshold;
- if (ISMOUSE(event->prev_type)) {
- BLI_assert(event->prev_type != MOUSEMOVE);
+ if (ISMOUSE(event->prev_click_type)) {
+ BLI_assert(event->prev_click_type != MOUSEMOVE);
/* Using the previous type is important is we want to check the last pressed/released button,
* The `event->type` would include #MOUSEMOVE which is always the case when dragging
* and does not help us know which threshold to use. */