### Godot version

Latest 4.0.dev (a3a42159e31db27f8ae7c1ecad6a9ed417cb05de)

### System information

Ubuntu 22.04.1 LTS

### Issue description

Ctrl+Shift+F (Find in Files) in the text editor, for example, causes my laptop to freeze consistently. I also reproduced it with F1 and Ctrl+Shift+R, as well as by using the dropdown instead of shortcuts.

### Steps to reproduce

Trivial

### Minimal reproduction project

N/A
event.xbutton.y = last_mouse_pos.y;
				}
				Ref<InputEventMouseButton> mb;
				mb.instantiate();
				mb->set_window_id(window_id);
				_get_key_modifier_state(event.xbutton.state, mb);
				mb->set_button_index((MouseButton)event.xbutton.button);
				if (mb->get_button_index() == MouseButton::RIGHT) {
					mb->set_button_index(MouseButton::MIDDLE);
				} else if (mb->get_button_index() == MouseButton::MIDDLE) {
					mb->set_button_index(MouseButton::RIGHT);
				}
				mb->set_button_mask(_get_mouse_button_state(mb->get_button_index(), event.xbutton.type));
				mb->set_position(Vector2(event.xbutton.x, event.xbutton.y));
				mb->set_global_position(mb->get_position());
				mb->set_pressed((event.type == ButtonPress));
				const WindowData &wd = windows[window_id];
				if (event.type == ButtonPress) {
					DEBUG_LOG_X11("[%u] ButtonPress window=%lu (%u), button_index=%u \n", frame, event.xbutton.window, window_id, mb->get_button_index());
					
					
					
					if (!wd.no_focus && !wd.is_popup) {
						XSetInputFocus(x11_display, wd.x11_window, RevertToPointerRoot, CurrentTime);
					}
					uint64_t diff = OS::get_singleton()->get_ticks_usec() / 1000 - last_click_ms;
					if (mb->get_button_index() == last_click_button_index) {
						if (diff < 400 && Vector2(last_click_pos).distance_to(Vector2(event.xbutton.x, event.xbutton.y)) < 5) {
							last_click_ms = 0;
							last_click_pos = Point2i(-100, -100);