Repository: godot
Issue: Input.is_action_just_released() not Passed to Parent if Child is removed/invisible
Labels: discussion,topic:input

**Godot version:**
Godot 3.2.3.stable

**OS/device including version:**
Windows 10

_Let me preface this with that I am not 100% sure that this is not intended behaviour. However, if it is intended behaviour, it is still odd to me, and worthy of a possible feature request._

**Issue description:**

While working on UI, I was making a `PanelContainer Scene` be deleted when it is clicked on. To give additional feedback to the player, I change the Texture used by the cursor (from a pointing hand to a clicked hand). On my usual buttons and UI, I then change the cursor back when the left mouse button is released. That usually happens with code similar to this:

```
func gui_input(_event):
	if Input.is_action_just_pressed("Mouse_Down"):
		Input.set_custom_mouse_cursor(load("res://click.png"), Input.CURSOR_POINTING_HAND)
	if Input.is_action_just_released("Mouse_Down"):
		Input.set_custom_mouse_cursor(load("res://point.png"), Input.CURSOR_POINTING_HAND)
```

However, when doing this on the PanelContainer Scene mentioned above, that obviously doesn't work. The scene is already being removed, so the script can't call the `is_action_just_released`. Makes complete sense. I decided that the best option was to put the PanelContainer that is being clicked on `MouseFilter_Pass`, so when the PanelContainer is clicked, it's parent will also receive the GUI_Input, and can handle the  `is_action_just_released` even after it's child is gone.

And that's where the behaviour starts confusing me. Both the `Input.is_action_just_pressed` calls go through (in Parent & Child), but the `Input.is_action_just_released` is never made in the Parent, if the child is removed. It seems that when the Child node that started the InputEvent is removed, the Mouse button is no longer `pressed` for any other nodes that the Input is passed to, causing it never to be released. I would expect the `is_action_just_released` call to still go through on the Parent, even if the Child is removed.

After some further debugging I noticed this also happens if the Child is simply made invisible by `.visible = false`. The parent does receive the initial `Input.is_action_just_pressed("Mouse_Down")`, but the `Input.is_action_just_released("Mouse_Down")` (after the child has become invisible) never happens.

Just to clarify, when the Child is not modified (so not being made invisible or removed) both calls are made in both the Child & Parent, as expected. Therefore I think the Parent not receiving an InputEvent (when the child is removed) for a released button, even though (due to the 'MouseFilter_Pass') it was also clicked and released on, is a bug.

![MRP is_action_just_released](https://user-images.githubusercontent.com/10502115/98485610-f8e0b400-2217-11eb-897f-cca78666c5ca.gif)
Here is some footage from the Minimum Reproduction Production that I made. Please watch the output log to see which Input Events are called. On the two right Panels, input events are only called on the click, but not on the release.

Perhaps I am just fully misunderstanding how the system works, but in my mind this behaviour is incorrect. 

**Steps to reproduce:**
The easiest way would be to check the Reproduction Project linked below.
Clicking the right two Panels in the MRP only shows the `Input.is_action_just_pressed("lmb")` being called, and never `Input.is_action_just_released("lmb")` when the mouse is released.

**Minimal reproduction project:**
[actionreleasedNotPassedToParent.zip](https://github.com/godotengine/godot/files/5507268/actionreleasedNotPassedToParent.zip)