diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 714312ef593..7a066ef4282 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -194,16 +194,17 @@ void WM_drag_free_list(struct ListBase *lb) static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, const wmEvent *event) { - wmEventHandler *handler = handlers->first; - for (; handler; handler = handler->next) { - if (handler->dropboxes) { - wmDropBox *drop = handler->dropboxes->first; - for (; drop; drop = drop->next) { - const char *tooltip = NULL; - if (drop->poll(C, drag, event, &tooltip)) { - /* XXX Doing translation here might not be ideal, but later we have no more - * access to ot (and hence op context)... */ - return (tooltip) ? tooltip : RNA_struct_ui_name(drop->ot->srna); + for (wmEventHandler *handler_base = handlers->first; handler_base; handler_base = handler_base->next) { + if (handler_base->type == WM_HANDLER_TYPE_DROPBOX) { + wmEventHandler_Dropbox *handler = (wmEventHandler_Dropbox *)handler_base; + if (handler->dropboxes) { + for (wmDropBox *drop = handler->dropboxes->first; drop; drop = drop->next) { + const char *tooltip = NULL; + if (drop->poll(C, drag, event, &tooltip)) { + /* XXX Doing translation here might not be ideal, but later we have no more + * access to ot (and hence op context)... */ + return (tooltip) ? tooltip : RNA_struct_ui_name(drop->ot->srna); + } } } } |