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 39919e3532
,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
This commit is contained in:
parent
fc08fe82ae
commit
1638af109e
Notes:
blender-bot
2023-09-13 08:48:34 +02:00
Referenced by commit c4ef90f5a0
, Fix click-drag regression in fix for T86116
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue