### 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 (event.xany.window == E.value.x11_window) {
				window_id = E.key;
				break;
			}
			if (event.xany.window == E.value.x11_xim_window) {
				window_id = E.key;
				ime_window_event = true;
				break;
			}
		}
		if (XGetEventData(x11_display, &event.xcookie)) {
			if (event.xcookie.type == GenericEvent && event.xcookie.extension == xi.opcode) {
				XIDeviceEvent *event_data = (XIDeviceEvent *)event.xcookie.data;
				int index = event_data->detail;
				Vector2 pos = Vector2(event_data->event_x, event_data->event_y);
				switch (event_data->evtype) {
					case XI_HierarchyChanged:
					case XI_DeviceChanged: {
						_refresh_device_info();
					} break;
					case XI_RawMotion: {
						if (ime_window_event) {
							break;
						}
						XIRawEvent *raw_event = (XIRawEvent *)event_data;
						int device_id = raw_event->sourceid;
						
						
						
						if (raw_event->valuators.mask_len <= 0) {