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

}
		
		
		{
			const long pid = OS::get_singleton()->get_process_id();
			Atom net_wm_pid = XInternAtom(x11_display, "_NET_WM_PID", False);
			if (net_wm_pid != None) {
				XChangeProperty(x11_display, wd.x11_window, net_wm_pid, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1);
			}
		}
		long im_event_mask = 0;
		{
			XIEventMask all_event_mask;
			XSetWindowAttributes new_attr;
			new_attr.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask |
					ButtonReleaseMask | EnterWindowMask |
					LeaveWindowMask | PointerMotionMask |
					Button1MotionMask |
					Button2MotionMask | Button3MotionMask |
					Button4MotionMask | Button5MotionMask |
					ButtonMotionMask | KeymapStateMask |
					ExposureMask | VisibilityChangeMask |
					StructureNotifyMask |
					SubstructureNotifyMask | SubstructureRedirectMask |
					FocusChangeMask | PropertyChangeMask |
					ColormapChangeMask | OwnerGrabButtonMask |
					im_event_mask;
			XChangeWindowAttributes(x11_display, wd.x11_window, CWEventMask, &new_attr);
			static unsigned char all_mask_data[XIMaskLen(XI_LASTEVENT)] = {};
			all_event_mask.deviceid = XIAllDevices;