### 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
preedit_start_callback.client_data = (::XPointer)(this);
				preedit_start_callback.callback = (::XIMProc)(void *)(_xim_preedit_start_callback);
				::XIMCallback preedit_done_callback;
				preedit_done_callback.client_data = (::XPointer)(this);
				preedit_done_callback.callback = (::XIMProc)(_xim_preedit_done_callback);
				::XIMCallback preedit_draw_callback;
				preedit_draw_callback.client_data = (::XPointer)(this);
				preedit_draw_callback.callback = (::XIMProc)(_xim_preedit_draw_callback);
				::XIMCallback preedit_caret_callback;
				preedit_caret_callback.client_data = (::XPointer)(this);
				preedit_caret_callback.callback = (::XIMProc)(_xim_preedit_caret_callback);
				::XVaNestedList preedit_attributes = XVaCreateNestedList(0,
						XNPreeditStartCallback, &preedit_start_callback,
						XNPreeditDoneCallback, &preedit_done_callback,
						XNPreeditDrawCallback, &preedit_draw_callback,
						XNPreeditCaretCallback, &preedit_caret_callback,
						(char *)nullptr);
				wd.xic = XCreateIC(xim,
						XNInputStyle, xim_style,
						XNClientWindow, wd.x11_xim_window,
						XNFocusWindow, wd.x11_xim_window,
						XNPreeditAttributes, preedit_attributes,
						(char *)nullptr);
				XFree(preedit_attributes);
			} else {
				wd.xic = XCreateIC(xim,
						XNInputStyle, xim_style,
						XNClientWindow, wd.x11_xim_window,
						XNFocusWindow, wd.x11_xim_window,
						(char *)nullptr);