### 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
_THREAD_SAFE_METHOD_
	Vector<int> ret;
	for (const KeyValue<WindowID, WindowData> &E : windows) {
		ret.push_back(E.key);
	}
	return ret;
}
DisplayServer::WindowID DisplayServerX11::create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect) {
	_THREAD_SAFE_METHOD_
	WindowID id = _create_window(p_mode, p_vsync_mode, p_flags, p_rect);
	for (int i = 0; i < WINDOW_FLAG_MAX; i++) {
		if (p_flags & (1 << i)) {
			window_set_flag(WindowFlags(i), true, id);
		}
	}
	return id;
}
void DisplayServerX11::show_window(WindowID p_id) {
	_THREAD_SAFE_METHOD_
	const WindowData &wd = windows[p_id];
	popup_open(p_id);
	DEBUG_LOG_X11("show_window: %lu (%u) \n", wd.x11_window, p_id);
	XMapWindow(x11_display, wd.x11_window);
	XSync(x11_display, False);
	_validate_mode_on_map(p_id);
}
void DisplayServerX11::delete_sub_window(WindowID p_id) {
	_THREAD_SAFE_METHOD_
	ERR_FAIL_COND(!windows.has(p_id));