diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 3ff3117dafe..b28ae16c5a1 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -4583,6 +4583,20 @@ void WM_event_remove_area_handler(ListBase *handlers, void *area) } } +wmOperator *WM_operator_find_modal_by_type(wmWindow *win, const wmOperatorType *ot) +{ + LISTBASE_FOREACH (wmEventHandler *, handler_base, &win->modalhandlers) { + if (handler_base->type != WM_HANDLER_TYPE_OP) { + continue; + } + wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base; + if (handler->op && handler->op->type == ot) { + return handler->op; + } + } + return NULL; +} + #if 0 static void WM_event_remove_handler(ListBase *handlers, wmEventHandler *handler) { |