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 <ideasman42@gmail.com>2021-03-02 10:19:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-02 10:40:15 +0300
commitc4ef90f5a0b1d05b16187eb6e32323defe6461c0 (patch)
tree7a191a715a5a82d25f28eaea71a6a177cf44e43b /source/blender/windowmanager/intern/wm_event_query.c
parentae96db0cf5576a2995132e6478dbb3508c02e58f (diff)
Fix click-drag regression in fix for T86116
1638af109e46522a1a24645289016922bb9ca977 & bfc70a6a958b9c35bde765ea8a02e8b1fd36db8b caused a regression with click-drag (not tweak which has it's own logic). Restore some changes from these commits with added comments. Minor changes from previous functionality from 39919e35326c732141bfd2d740b19000b6bc1d51. - `prevval` & `prevtype` are now set for all kinds of new events in the queue previously this was not done for some kinds of events (mouse wheel, ndof - for example). - Set `prevval` & `prevtype` for other windows for mouse buttons.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_query.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index 2f5332e9672..9b9be6bb497 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -280,8 +280,11 @@ int WM_event_drag_threshold(const struct wmEvent *event)
if (WM_event_is_tablet(event)) {
drag_threshold = U.drag_threshold_tablet;
}
- else if (ISMOUSE(event->type)) {
- /* Mouse button or mouse motion. */
+ else if (ISMOUSE(event->prevtype)) {
+ BLI_assert(event->prevtype != 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. */
drag_threshold = U.drag_threshold_mouse;
}
else {