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

if (p_style_a == 0) {
		return p_style_b;
	}
	if (p_style_b == 0) {
		return p_style_a;
	}
	const ::XIMStyle preedit = XIMPreeditArea | XIMPreeditCallbacks | XIMPreeditPosition | XIMPreeditNothing | XIMPreeditNone;
	const ::XIMStyle status = XIMStatusArea | XIMStatusCallbacks | XIMStatusNothing | XIMStatusNone;
	::XIMStyle a = p_style_a & preedit;
	::XIMStyle b = p_style_b & preedit;
	if (a != b) {
		
		if ((a | b) & XIMPreeditCallbacks) {
			return a == XIMPreeditCallbacks ? p_style_a : p_style_b;
		} else if ((a | b) & XIMPreeditPosition) {
			return a == XIMPreeditPosition ? p_style_a : p_style_b;
		} else if ((a | b) & XIMPreeditArea) {
			return a == XIMPreeditArea ? p_style_a : p_style_b;
		} else if ((a | b) & XIMPreeditNothing) {
			return a == XIMPreeditNothing ? p_style_a : p_style_b;
		}
	} else {
		
		a = p_style_a & status;
		b = p_style_b & status;
		if ((a | b) & XIMStatusCallbacks) {