diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-21 12:43:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-21 15:35:46 +0300 |
commit | d782bad62dc53373bb28811c0672da81924371d6 (patch) | |
tree | f51221c1773a3ba7785ff7a9364d4bbd421777a7 /source/blender | |
parent | b4017ccb649c63e1b0d74b54f81557fbaf7e54aa (diff) |
WM: ensure is_repeat isn't copied from the last event
This means if a keymap item is set to ignore repeat events,
it may do so accidentally from this setting being copied.
Diffstat (limited to 'source/blender')
6 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index b3ed6ac09b3..601ab44c3d6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -6757,6 +6757,7 @@ void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but) event.type = EVT_BUT_OPEN; event.val = KM_PRESS; + event.is_repeat = false; event.customdata = but; event.customdatafree = false; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 95bb27d9fca..b77f8bf3b63 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -8546,6 +8546,7 @@ void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but) wm_event_init_from_window(win, &event); event.type = EVT_BUT_OPEN; event.val = KM_PRESS; + event.is_repeat = false; event.customdata = but; event.customdatafree = false; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 0d24992671f..27a1d4e4a50 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -976,6 +976,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type) } event.val = KM_NOTHING; + event.is_repeat = false; event.customdata = op->customdata; event.customdatafree = true; op->customdata = NULL; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 07d5ffa1b82..e6ec68f706c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -663,6 +663,7 @@ void wm_event_handler_ui_cancel_ex(bContext *C, wm_event_init_from_window(win, &event); event.type = EVT_BUT_CANCEL; event.val = reactivate_button ? 0 : 1; + event.is_repeat = false; handler->handle_fn(C, &event, handler->user_data); } } diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c index 8357d4c2331..00112e82771 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.c +++ b/source/blender/windowmanager/intern/wm_gesture_ops.c @@ -519,6 +519,7 @@ static void gesture_tweak_modal(bContext *C, const wmEvent *event) tevent.type = EVT_TWEAK_M; } tevent.val = val; + tevent.is_repeat = false; /* mouse coords! */ /* important we add immediately after this event, so future mouse releases diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b43e033c7ca..6c9b6915da8 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1301,6 +1301,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr event.type = MOUSEMOVE; event.prevx = event.x; event.prevy = event.y; + event.is_repeat = false; wm_event_add(win, &event); @@ -1432,6 +1433,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr event.type = MOUSEMOVE; event.prevx = event.x; event.prevy = event.y; + event.is_repeat = false; /* No context change! C->wm->windrawable is drawable, or for area queues. */ wm->winactive = win; @@ -1568,6 +1570,7 @@ static int wm_window_timer(const bContext *C) event.type = wt->event_type; event.val = KM_NOTHING; event.keymodifier = 0; + event.is_repeat = false; event.custom = EVT_DATA_TIMER; event.customdata = wt; wm_event_add(win, &event); |