Fix #110723: cant drop object name on object field/socket in node editor #110929

Merged
Philipp Oeser merged 3 commits from lichtwerk/blender:110723 into main 2023-08-14 13:12:40 +02:00

3 Commits

Author SHA1 Message Date
Philipp Oeser 79fb23b4b2 remove UI_but_active_drop_name from the operator polls 2023-08-11 13:36:49 +02:00
Philipp Oeser f2de602165 Merge branch 'main' into 110723 2023-08-11 13:03:32 +02:00
Philipp Oeser 117d04f2d1 Fix #110723: cant drop object name on object field/socket in node editor
Reason was a difference in poll functions (dropbox poll function vs.
operator poll function).

So the dropbox was actually recognized as being active (see
`dropbox_active`) but then when actually dropping, the corresponding
operator wasnt called (but instead another operator was).

In detail, the way `wm_handlers_do_intern` works, it checks all
dropboxes poll function if one succeeds it calls the dropbox operator.
But if that operators poll function fails, `wm_handlers_do_intern`
happily continues and "ends" the drop operations in a way we dont
actually get to the "real" dropbox & operator that was also recognized
as being active.

In the case of the report:
- dropbox for `UI_OT_drop_name` is active
- dropbox poll for `NODE_OT_add_object` (`node_object_drop_poll`)
succeeds though
- operator poll for `NODE_OT_add_object` (`node_add_object_poll`) fails
(it checks `UI_but_active_drop_name` already)

So in order to make this work, bring the poll functions in sync by
adding the check for `UI_but_active_drop_name` to two dropbox poll
functions as well.

Probably good for LTS as well.
2023-08-08 15:31:24 +02:00