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-01 03:51:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-01 04:00:29 +0300
commit1638af109e46522a1a24645289016922bb9ca977 (patch)
treee4099e4c548e437f75a9abe0e560aa7bf89a5daa
parentfc08fe82ae5da2c4675ac6a6c1707dce28324d26 (diff)
WM: don't set event prevval/prevtype on cursor motion
Currently the intended behavior regarding prevval/prevtype isn't handled consistently. However, including cursor motion causes events in `wm->queue` and `wm->eventstate` to behave differently, where `wm->eventstate` ignores motion (necessary for click detection). This makes checks from `wm->eventstate` to events in the queue fail. This reverts 39919e35326c732141bfd2d740b19000b6bc1d51, using the `event.type` instead of it's previous type. This works as it includes mouse button release events.
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c3
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index ab8f37548b7..2f5332e9672 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -280,7 +280,8 @@ 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->prevtype)) {
+ else if (ISMOUSE(event->type)) {
+ /* Mouse button or mouse motion. */
drag_threshold = U.drag_threshold_mouse;
}
else {
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index dc38bd79b7d..5d015a48246 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -4430,8 +4430,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void
wm_stereo3d_mouse_offset_apply(win, &event.x);
wm_tablet_data_from_ghost(&cd->tablet, &event.tablet);
- event.prevtype = event.type;
- event.prevval = event.val;
event.type = MOUSEMOVE;
{
wmEvent *event_new = wm_event_add_mousemove(win, &event);
@@ -4448,8 +4446,6 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void
oevent = *oevt;
copy_v2_v2_int(&oevent.x, &event.x);
- oevent.prevtype = oevent.type;
- oevent.prevval = oevent.val;
oevent.type = MOUSEMOVE;
{
wmEvent *event_new = wm_event_add_mousemove(owin, &oevent);