diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-16 16:53:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-16 16:53:04 +0300 |
commit | bfc0f483c626a1af1f18f8d7a9748c901cb48f2f (patch) | |
tree | 199af9b8e961f40ea240b075e64cb5bd688b7ec3 | |
parent | 7aa38de085cbd3deac2330434c714f0ee58856f5 (diff) | |
parent | 7bbead1e87254623deed56f588e65f524d14343b (diff) |
Merge branch 'blender-v2.93-release'
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 |
3 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 130b308f224..59091fec4b8 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -278,8 +278,14 @@ typedef struct wmWindow { char event_queue_check_click; /** Enable when #KM_PRESS events are not handled (keyboard/mouse-buttons only). */ char event_queue_check_drag; + /** + * Enable when the drag was handled, + * to avoid mouse-motion continually triggering drag events which are not handled + * but add overhead to gizmo handling (for example), see T87511. + */ + char event_queue_check_drag_handled; - char _pad0[2]; + char _pad0[1]; /** Internal, lock pie creation from this event until released. */ short pie_event_type_lock; diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index ae5b6c468f7..46e47ae95c4 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -186,6 +186,7 @@ static void window_manager_blend_read_data(BlendDataReader *reader, ID *id) win->addmousemove = true; win->event_queue_check_click = 0; win->event_queue_check_drag = 0; + win->event_queue_check_drag_handled = 0; BLO_read_data_address(reader, &win->stereo3d_format); /* Multi-view always fallback to anaglyph at file opening diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 627ec1d5722..cb4aa3b6549 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2941,6 +2941,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) if (wm_action_not_handled(action)) { if (win->event_queue_check_drag) { if (WM_event_drag_test(event, &event->prevclickx)) { + win->event_queue_check_drag_handled = true; + int x = event->x; int y = event->y; short val = event->val; @@ -2984,6 +2986,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) if (event->is_repeat == false) { win->event_queue_check_click = true; win->event_queue_check_drag = true; + win->event_queue_check_drag_handled = false; } } else if (event->val == KM_RELEASE) { @@ -3470,6 +3473,13 @@ void wm_event_do_handlers(bContext *C) win->event_queue_check_click = false; } + /* If the drag even was handled, don't attempt to keep re-handing the same + * drag event on every cursor motion, see: T87511. */ + if (win->event_queue_check_drag_handled) { + win->event_queue_check_drag = false; + win->event_queue_check_drag_handled = false; + } + /* Update previous mouse position for following events to use. */ win->eventstate->prevx = event->x; win->eventstate->prevy = event->y; |