From d7053ba030f62c8eb597f6aa24525a96b3c42a17 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 18 May 2022 14:25:05 +1000 Subject: Fix T98191: Alt-LMB for node detach fails with RMB select Regression caused by [0] which changed node selection to use PRESS for selection and CLICK_DRAG to transform the selection. This conflicted with Alt-LMB which would select the node then pass-though to node.background_sample, preventing the drag event from being activated. Resolve by only activating background-sample when the cursor isn't over a node or socket. [0]: 4c3e91e5f565b81dd79b5d42f55be5b93662d410 --- source/blender/editors/space_node/node_view.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/space_node/node_view.cc') diff --git a/source/blender/editors/space_node/node_view.cc b/source/blender/editors/space_node/node_view.cc index 91a21527ac9..6f30632244b 100644 --- a/source/blender/editors/space_node/node_view.cc +++ b/source/blender/editors/space_node/node_view.cc @@ -643,6 +643,12 @@ static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) ARegion *region = CTX_wm_region(C); ImageSampleInfo *info; + /* Don't handle events intended for nodes (which rely on click/drag distinction). + * which this operator would use since sampling is normally activated on press, see: T98191. */ + if (node_or_socket_isect_event(C, event)) { + return OPERATOR_PASS_THROUGH; + } + if (!ED_node_is_compositor(snode) || !(snode->flag & SNODE_BACKDRAW)) { return OPERATOR_CANCELLED; } -- cgit v1.2.3