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

all_event_mask.mask_len = sizeof(all_mask_data);
			all_event_mask.mask = all_mask_data;
			XISetMask(all_event_mask.mask, XI_HierarchyChanged);
#ifdef TOUCH_ENABLED
			if (xi.touch_devices.size()) {
				XISetMask(all_event_mask.mask, XI_TouchBegin);
				XISetMask(all_event_mask.mask, XI_TouchUpdate);
				XISetMask(all_event_mask.mask, XI_TouchEnd);
				XISetMask(all_event_mask.mask, XI_TouchOwnership);
			}
#endif
			XISelectEvents(x11_display, wd.x11_window, &all_event_mask, 1);
		}
		
		XStoreName(x11_display, wd.x11_window, "Godot");
		XSetWMProtocols(x11_display, wd.x11_window, &wm_delete, 1);
		if (xdnd_aware != None) {
			XChangeProperty(x11_display, wd.x11_window, xdnd_aware, XA_ATOM, 32, PropModeReplace, (unsigned char *)&xdnd_version, 1);
		}
		if (xim && xim_style) {
			
			
			MutexLock mutex_lock(events_mutex);
			
			if ((xim_style & XIMPreeditPosition) != 0) {
				xim_style &= ~XIMPreeditPosition;
				xim_style |= XIMPreeditCallbacks;
			}
			if ((xim_style & XIMPreeditCallbacks) != 0) {
				::XIMCallback preedit_start_callback;