[Bf-blender-cvs] [7197017ea95] master: WM: only use the tablet drag threshold for mouse button events
Campbell Barton
noreply at git.blender.org
Thu Jun 3 17:19:18 CEST 2021
Commit: 7197017ea951eadddeea5a7b3941cabee2b960db
Author: Campbell Barton
Date: Fri Jun 4 01:15:15 2021 +1000
Branches: master
https://developer.blender.org/rB7197017ea951eadddeea5a7b3941cabee2b960db
WM: only use the tablet drag threshold for mouse button events
Keyboard click-drag events now use the "Drag Threshold".
This resolves a problem where keyboard click drag events
used a much smaller threshold when using a tablet.
===================================================================
M source/blender/windowmanager/intern/wm_event_query.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index 3efff20f107..0050c834a56 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -282,15 +282,17 @@ bool WM_event_is_mouse_drag(const wmEvent *event)
int WM_event_drag_threshold(const struct wmEvent *event)
{
int drag_threshold;
- if (WM_event_is_tablet(event)) {
- drag_threshold = U.drag_threshold_tablet;
- }
- else if (ISMOUSE(event->prevtype)) {
+ 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;
+ if (WM_event_is_tablet(event)) {
+ drag_threshold = U.drag_threshold_tablet;
+ }
+ else {
+ drag_threshold = U.drag_threshold_mouse;
+ }
}
else {
/* Typically keyboard, could be NDOF button or other less common types. */
More information about the Bf-blender-cvs
mailing list