### Godot version

v4.2.dev3.official [013e8e3af]

### System information

Windows 10, 64bit

### Issue description

![image](https://github.com/godotengine/godot/assets/35988767/ccdac68c-a60d-491b-a406-d6e3bc1c95ae)
![GIF](https://github.com/godotengine/godot/assets/35988767/7d230faf-0260-4bc3-92e8-11cd026931a8)


### Steps to reproduce

/

### Minimal reproduction project

/
#include "tab_container.h"
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"
#include "scene/gui/texture_rect.h"
int TabContainer::_get_top_margin() const {
	int height = 0;
	if (tabs_visible && get_tab_count() > 0) {
		height = tab_bar->get_minimum_size().height;
	}
	return height;
}
void TabContainer::gui_input(const Ref<InputEvent> &p_event) {
	ERR_FAIL_COND(p_event.is_null());
	Ref<InputEventMouseButton> mb = p_event;
	Popup *popup = get_popup();
	if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT) {
		Point2 pos = mb->get_position();
		Size2 size = get_size();
		
		if (pos.y > _get_top_margin()) {
			return;
		}
		
		if (is_layout_rtl()) {
			if (popup && pos.x < theme_cache.menu_icon->get_width()) {
				emit_signal(SNAME("pre_popup_pressed"));
				Vector2 popup_pos = get_screen_position();