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

XEvent config_event;
	while (XCheckTypedEvent(x11_display, ConfigureNotify, &config_event)) {
		_window_changed(&config_event);
	}
	events_thread.start(_poll_events_thread, this);
	_update_real_mouse_position(windows[MAIN_WINDOW_ID]);
#ifdef DBUS_ENABLED
	screensaver = memnew(FreeDesktopScreenSaver);
	screen_set_keep_on(GLOBAL_GET("display/window/energy_saving/keep_screen_on"));
	portal_desktop = memnew(FreeDesktopPortalDesktop);
#endif
	r_error = OK;
}
DisplayServerX11::~DisplayServerX11() {
	
	Window x11_main_window = windows[MAIN_WINDOW_ID].x11_window;
	_clipboard_transfer_ownership(XA_PRIMARY, x11_main_window);
	_clipboard_transfer_ownership(XInternAtom(x11_display, "CLIPBOARD", 0), x11_main_window);
	events_thread_done.set();
	events_thread.wait_to_finish();
	
	for (KeyValue<WindowID, WindowData> &E : windows) {
#ifdef VULKAN_ENABLED
		if (context_vulkan) {
			context_vulkan->window_destroy(E.key);
		}
#endif
#ifdef GLES3_ENABLED
		if (gl_manager) {