### 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)

Ref<Theme> theme;
	StringName theme_type_variation;
	bool bulk_theme_override = false;
	Theme::ThemeIconMap theme_icon_override;
	Theme::ThemeStyleMap theme_style_override;
	Theme::ThemeFontMap theme_font_override;
	Theme::ThemeFontSizeMap theme_font_size_override;
	Theme::ThemeColorMap theme_color_override;
	Theme::ThemeConstantMap theme_constant_override;
	mutable HashMap<StringName, Theme::ThemeIconMap> theme_icon_cache;
	mutable HashMap<StringName, Theme::ThemeStyleMap> theme_style_cache;
	mutable HashMap<StringName, Theme::ThemeFontMap> theme_font_cache;
	mutable HashMap<StringName, Theme::ThemeFontSizeMap> theme_font_size_cache;
	mutable HashMap<StringName, Theme::ThemeColorMap> theme_color_cache;
	mutable HashMap<StringName, Theme::ThemeConstantMap> theme_constant_cache;
	void _theme_changed();
	void _notify_theme_override_changed();
	void _invalidate_theme_cache();
	Viewport *embedder = nullptr;
	Transform2D window_transform;
	friend class Viewport; 
	void _window_input(const Ref<InputEvent> &p_ev);
	void _window_input_text(const String &p_text);
	void _window_drop_files(const Vector<String> &p_files);
	void _rect_changed_callback(const Rect2i &p_callback);
	void _event_callback(DisplayServer::WindowEvent p_event);
	virtual bool _can_consume_input_events() const override;
	Ref<Shortcut> debugger_stop_shortcut;
protected:
	virtual Rect2i _popup_adjust_rect() const { return Rect2i(); }