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

} break;
			case EnterNotify: {
				DEBUG_LOG_X11("[%u] EnterNotify window=%lu (%u), mode='%u' \n", frame, event.xcrossing.window, window_id, event.xcrossing.mode);
				if (ime_window_event) {
					break;
				}
				if (!mouse_mode_grab) {
					_send_window_event(windows[window_id], WINDOW_EVENT_MOUSE_ENTER);
				}
			} break;
			case FocusIn: {
				DEBUG_LOG_X11("[%u] FocusIn window=%lu (%u), mode='%u' \n", frame, event.xfocus.window, window_id, event.xfocus.mode);
				if (ime_window_event) {
					break;
				}
				WindowData &wd = windows[window_id];
				last_focused_window = window_id;
				wd.focused = true;
				
				static unsigned int focus_order = 0;
				wd.focus_order = ++focus_order;
				_send_window_event(wd, WINDOW_EVENT_FOCUS_IN);
				if (mouse_mode_grab) {
					
					for (const KeyValue<WindowID, WindowData> &E : windows) {
						if (mouse_mode == MOUSE_MODE_CONFINED) {
							XUndefineCursor(x11_display, E.value.x11_window);
						} else if (mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) { 
							XDefineCursor(x11_display, E.value.x11_window, null_cursor);
						}