### 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
} else {
		MutexLock mutex_lock(events_mutex);
		XUnsetICFocus(wd.xic);
		XUnmapWindow(x11_display, wd.x11_xim_window);
		wd.ime_active = false;
		im_text = String();
		im_selection = Vector2i();
	}
	OS_Unix::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
}
void DisplayServerX11::window_set_ime_position(const Point2i &p_pos, WindowID p_window) {
	_THREAD_SAFE_METHOD_
	ERR_FAIL_COND(!windows.has(p_window));
	WindowData &wd = windows[p_window];
	if (!wd.xic) {
		return;
	}
	if (!wd.focused) {
		return;
	}
	if (wd.ime_active) {
		XWindowAttributes xwa;
		XSync(x11_display, False);
		XGetWindowAttributes(x11_display, wd.x11_xim_window, &xwa);
		if (xwa.map_state == IsViewable) {
			XMoveWindow(x11_display, wd.x11_xim_window, p_pos.x, p_pos.y);
		}
	}
}
Point2i DisplayServerX11::ime_get_selection() const {