So i have a GraphEditor. There is have connected the popup_request signal. I have some GraphNodes as children of the GraphEditor node. Those GraphNodes' mouse-filter is set to stop. If i rightclick them, the popup_request signal on the GraphEditor gets fired, even if the event should not be propagated to the GraphEditor. Am i using something wrong or is this a bug?

So just this: So just create a GraphEditor, add GraphNode as child. In GraphEditor, connect the popup_request signal. In the GraphNode, set mouse-filter to stop. Right-click the Node and see the popup_request is getting fired.

So i found out that the mouse-filter on GraphNode doesn't get set. I attached a gui_input handler on the GraphNode and printed out the current mouse-filter. It prints 1, which is MOUSE_FILTER_PASS. It still prints 1, even if i set it to STOP in the editor, or in the ready() function of the GraphNode. My workaround is to wait for the _gui_input event to get triggerd on the GraphNode and there set the mouse filter. In this case the event doesn't get triggered in the GraphEditor.

This works but is a really ugly hack. So am i using this wrong or is this really a bug in Godot?

Ok, so the problem is, if you set the mouse-filter to STOP, you cannot drag and drop GraphNodes. So i think Godot prevents this. This is just missing information in the documentation. In my case, i only need to filter right mouse clicks. So i just wrote that in GraphNode:

func _on_GraphNode_gui_input(event):
	if event is InputEventMouseButton and event.button_index == BUTTON_RIGHT and event.pressed:
		self.mouse_filter = Control.MOUSE_FILTER_STOP
	else:
		self.mouse_filter = Control.MOUSE_FILTER_PASS

That solved my problem.

4 years later