From 7fa88241a842874e67d0cdf04cf26931fc53a2ba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 8 Jan 2024 14:02:32 +1100 Subject: [PATCH] WM: ensure operator context isn't used for drop operator properties Since wmDropBox are setup with the editors and aren't re-initialized when the file is reloaded for e.g. it doesn't make sense to use the current context when setting up their properties. Note that this doesn't fix any user visible bugs and is more a issue of correctness. --- source/blender/windowmanager/intern/wm_dragdrop.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index e97e565475c..ec0e7461ade 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -123,6 +123,10 @@ wmDropBox *WM_dropbox_add(ListBase *lb, drop->ot = ot; WM_operator_properties_alloc(&(drop->ptr), &(drop->properties), idname); + WM_operator_properties_sanitize(drop->ptr, true); + + /* Signal for no context, see #STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID. */ + drop->ptr->owner_id = nullptr; BLI_addtail(lb, drop);