From aea7e555221e071e65fe76eb9571198622bbc547 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Oct 2021 19:01:46 +1100 Subject: WM: de-duplicate cursor motion checks for selection picking Replace local static mouse coordinate storage with a single function. also resolve inconsistencies. - Edit-mesh selection used equality check (ignoring `U.move_threshold`). - Motion to clear tooltips checked the value without scaling by the DPI. Also prevent the unlikely case of the previous motion check matching a different area by resetting the value when the active region changes. --- source/blender/editors/screen/screen_edit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/editors/screen') diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 841792d5f2d..fa0cfd16817 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -935,6 +935,10 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) } } } + + /* Ensure test-motion values are never shared between regions. */ + const bool use_cycle = !WM_cursor_test_motion_and_update((const int[2]){-1, -1}); + UNUSED_VARS(use_cycle); } /* Cursors, for time being set always on edges, -- cgit v1.2.3