Change to key modifier should trigger re-evaluation of drag-and-drop
This change is part of a fix for T40435, but will postpone for now. Original patch by Sergey Sharybin
This commit is contained in:
		@@ -593,8 +593,11 @@ static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent *
 | 
			
		||||
	Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
 | 
			
		||||
 | 
			
		||||
	/* either holding and ctrl and no object, or dropping to empty */
 | 
			
		||||
	if ((event->ctrl && !base) || (base && base->object->type == OB_EMPTY))
 | 
			
		||||
	if (((base == NULL) && event->ctrl) ||
 | 
			
		||||
	    ((base != NULL) && base->object->type == OB_EMPTY))
 | 
			
		||||
	{
 | 
			
		||||
		return view3d_ima_drop_poll(C, drag, event);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -2140,7 +2140,7 @@ static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *even
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	if (event->type == MOUSEMOVE)
 | 
			
		||||
	if (event->type == MOUSEMOVE || ISKEYMODIFIER(event->type))
 | 
			
		||||
		win->screen->do_draw_drag = true;
 | 
			
		||||
	else if (event->type == ESCKEY) {
 | 
			
		||||
		BLI_freelistN(&wm->drags);
 | 
			
		||||
@@ -2289,10 +2289,12 @@ void wm_event_do_handlers(bContext *C)
 | 
			
		||||
									/* call even on non mouse events, since the */
 | 
			
		||||
									wm_region_mouse_co(C, event);
 | 
			
		||||
 | 
			
		||||
									/* does polls for drop regions and checks uibuts */
 | 
			
		||||
									/* need to be here to make sure region context is true */
 | 
			
		||||
									if (ELEM(event->type, MOUSEMOVE, EVT_DROP)) {
 | 
			
		||||
										wm_drags_check_ops(C, event);
 | 
			
		||||
									if (!BLI_listbase_is_empty(&wm->drags)) {
 | 
			
		||||
										/* does polls for drop regions and checks uibuts */
 | 
			
		||||
										/* need to be here to make sure region context is true */
 | 
			
		||||
										if (ELEM(event->type, MOUSEMOVE, EVT_DROP) || ISKEYMODIFIER(event->type)) {
 | 
			
		||||
											wm_drags_check_ops(C, event);
 | 
			
		||||
										}
 | 
			
		||||
									}
 | 
			
		||||
									
 | 
			
		||||
									action |= wm_handlers_do(C, event, &ar->handlers);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user