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-06-03 18:15:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-03 18:18:23 +0300
commit7197017ea951eadddeea5a7b3941cabee2b960db (patch)
treed6f8eed260fe195408ca1dffc44f8a19ad12a099 /source/blender/windowmanager
parented6fd01ba9cbf4bd7f121ce7be5406c533fd49c2 (diff)
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.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c12
1 files changed, 7 insertions, 5 deletions
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. */