### Godot version

4.0.stable

### System information

Windows 10

### Issue description

In my project, we are rendering a GUI to a QuadMesh as an in-game interactive display. We push mouse click events when the player clicks the display. This worked fine during 4.0 beta, but after moving to the stable release the buttons on TreeItems stopped working. I put together a MRP and went back through the versions and it seems the issue started in RC1.

### Steps to reproduce

When running the MRP, it has a standard GUI on the left hand side of the screen and a QuadMesh rendered GUI on the right hand side. If you click the + button on an item, it will add another item to the list. On the QuadMesh you will see that you can highlight and collapse items in the list, but the + button does not function. If you run the MRP on 4.0.beta17 everything will function as expected.

### Minimal reproduction project

[TreeUI_through_SubViewport.zip](https://github.com/godotengine/godot/files/10959159/TreeUI_through_SubViewport.zip)

NOTIFICATION_VISIBILITY_CHANGED = 30,
		NOTIFICATION_POST_POPUP = 31,
		NOTIFICATION_THEME_CHANGED = 32
	};
	void set_title(const String &p_title);
	String get_title() const;
	void set_initial_position(WindowInitialPosition p_initial_position);
	WindowInitialPosition get_initial_position() const;
	void set_current_screen(int p_screen);
	int get_current_screen() const;
	void set_position(const Point2i &p_position);
	Point2i get_position() const;
	void set_size(const Size2i &p_size);
	Size2i get_size() const;
	void reset_size();
	Point2i get_position_with_decorations() const;
	Size2i get_size_with_decorations() const;
	void set_max_size(const Size2i &p_max_size);
	Size2i get_max_size() const;
	void set_min_size(const Size2i &p_min_size);
	Size2i get_min_size() const;
	void set_mode(Mode p_mode);
	Mode get_mode() const;
	void set_flag(Flags p_flag, bool p_enabled);
	bool get_flag(Flags p_flag) const;
	bool is_maximize_allowed() const;