Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-03-16 20:13:37 +0300
committerJulian Eisel <julian@blender.org>2020-03-16 20:13:37 +0300
commitd2ef342b2a50a7eac725889708fd689ffa126e25 (patch)
treed6606e846b40bf517ab13477003e5e556ae26b66 /source/blender/editors/space_view3d/space_view3d.c
parentcb6cec904fa14ce0ab10a2a53af5c936d56376cf (diff)
parente42f61dda8b635511f083c09ccda5db9d28ec172 (diff)
Merge branch 'master' into temp-openxr-ghostxr
Diffstat (limited to 'source/blender/editors/space_view3d/space_view3d.c')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 8ec7d5a166b..020c58270fc 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -436,35 +436,50 @@ static void view3d_main_region_exit(wmWindowManager *wm, ARegion *region)
ED_view3d_stop_render_preview(wm, region);
}
-static bool view3d_ob_drop_poll(bContext *UNUSED(C),
+static bool view3d_drop_id_in_main_region_poll(bContext *C,
+ wmDrag *drag,
+ const wmEvent *event,
+ ID_Type id_type)
+{
+ ScrArea *area = CTX_wm_area(C);
+ if (ED_region_overlap_isect_any_xy(area, &event->x)) {
+ return false;
+ }
+ return WM_drag_ID(drag, id_type) != NULL;
+}
+
+static bool view3d_ob_drop_poll(bContext *C,
wmDrag *drag,
- const wmEvent *UNUSED(event),
+ const wmEvent *event,
const char **UNUSED(tooltip))
{
- return WM_drag_ID(drag, ID_OB) != NULL;
+ return view3d_drop_id_in_main_region_poll(C, drag, event, ID_OB);
}
-static bool view3d_collection_drop_poll(bContext *UNUSED(C),
+static bool view3d_collection_drop_poll(bContext *C,
wmDrag *drag,
- const wmEvent *UNUSED(event),
+ const wmEvent *event,
const char **UNUSED(tooltip))
{
- return WM_drag_ID(drag, ID_GR) != NULL;
+ return view3d_drop_id_in_main_region_poll(C, drag, event, ID_GR);
}
-static bool view3d_mat_drop_poll(bContext *UNUSED(C),
+static bool view3d_mat_drop_poll(bContext *C,
wmDrag *drag,
- const wmEvent *UNUSED(event),
+ const wmEvent *event,
const char **UNUSED(tooltip))
{
- return WM_drag_ID(drag, ID_MA) != NULL;
+ return view3d_drop_id_in_main_region_poll(C, drag, event, ID_MA);
}
-static bool view3d_ima_drop_poll(bContext *UNUSED(C),
+static bool view3d_ima_drop_poll(bContext *C,
wmDrag *drag,
- const wmEvent *UNUSED(event),
+ const wmEvent *event,
const char **UNUSED(tooltip))
{
+ if (ED_region_overlap_isect_any_xy(CTX_wm_area(C), &event->x)) {
+ return false;
+ }
if (drag->type == WM_DRAG_PATH) {
/* rule might not work? */
return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));