From 649fdc793851a214f54c9ecdaae4c120c4bd11c9 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 12 Mar 2020 19:34:59 +0100 Subject: Fix T73049: Drag & drop on overlapping panels behaves incorrectly Reviewers: brecht, Severin Differential Revision: https://developer.blender.org/D7024 --- source/blender/editors/space_image/space_image.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index dc546e5baf5..42a8a746eef 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -262,18 +262,22 @@ static void image_keymap(struct wmKeyConfig *keyconf) } /* dropboxes */ -static bool image_drop_poll(bContext *UNUSED(C), +static bool image_drop_poll(bContext *C, wmDrag *drag, - const wmEvent *UNUSED(event), + const wmEvent *event, const char **UNUSED(tooltip)) { + ScrArea *area = CTX_wm_area(C); + if (ED_region_overlap_isect_any_xy(area, &event->x)) { + return false; + } if (drag->type == WM_DRAG_PATH) { /* rule might not work? */ if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { - return 1; + return true; } } - return 0; + return false; } static void image_drop_copy(wmDrag *drag, wmDropBox *drop) -- cgit v1.2.3