### 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
{
		XWindowAttributes xwa;
		XSync(x11_display, False);
		XGetWindowAttributes(x11_display, wd.x11_window, &xwa);
		wd.position.x = xwa.x;
		wd.position.y = xwa.y;
		wd.size.width = xwa.width;
		wd.size.height = xwa.height;
	}
	
	if (cursors[current_cursor] != None) {
		XDefineCursor(x11_display, wd.x11_window, cursors[current_cursor]);
	}
	return id;
}
static bool _is_xim_style_supported(const ::XIMStyle &p_style) {
	const ::XIMStyle supported_preedit = XIMPreeditCallbacks | XIMPreeditPosition | XIMPreeditNothing | XIMPreeditNone;
	const ::XIMStyle supported_status = XIMStatusNothing | XIMStatusNone;
	
	if ((p_style & supported_preedit) == 0) {
		return false;
	}
	
	if ((p_style & supported_status) == 0) {
		return false;
	}
	return true;
}
static ::XIMStyle _get_best_xim_style(const ::XIMStyle &p_style_a, const ::XIMStyle &p_style_b) {