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

_THREAD_SAFE_METHOD_
	ERR_FAIL_COND_V(!windows.has(p_window), WINDOW_MODE_WINDOWED);
	const WindowData &wd = windows[p_window];
	if (wd.fullscreen) { 
		if (wd.exclusive_fullscreen) {
			return WINDOW_MODE_EXCLUSIVE_FULLSCREEN;
		} else {
			return WINDOW_MODE_FULLSCREEN;
		}
	}
	
	
	if (_window_maximize_check(p_window, "_NET_WM_STATE")) {
		return WINDOW_MODE_MAXIMIZED;
	}
	{
		if (_window_minimize_check(p_window)) {
			return WINDOW_MODE_MINIMIZED;
		}
	}
	
	return WINDOW_MODE_WINDOWED;
}
void DisplayServerX11::window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window) {