### Godot version

v4.0.beta15.mono.official [4fa6edc88]

### System information

Linux, Xorg

### Issue description

The entire window loses focus if you ungrab focus from a Control. 
This doesn't seem to happen in Beta 14 and older betas.

### Steps to reproduce

1. Create a Control that can grab focus (tested with LineEdit and TextEdit)
2. Grab focus
3. Release focus via release_focus() or hiding the node

### Minimal reproduction project

[FocusMinimal.zip](https://github.com/godotengine/godot/files/10498175/FocusMinimal.zip)

{
		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) {