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

im_text = String();
					im_selection = Vector2i();
					OS_Unix::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE);
				}
				wd.focused = false;
				Input::get_singleton()->release_pressed_events();
				_send_window_event(wd, WINDOW_EVENT_FOCUS_OUT);
				if (mouse_mode_grab) {
					for (const KeyValue<WindowID, WindowData> &E : windows) {
						
						if (mouse_mode == MOUSE_MODE_CAPTURED) {
							
							XUndefineCursor(x11_display, E.value.x11_window);
						}
					}
					XUngrabPointer(x11_display, CurrentTime);
				}
#ifdef TOUCH_ENABLED
				
				/*for (int i = 0; i < xi.touch_devices.size(); ++i) {
					XIUngrabDevice(x11_display, xi.touch_devices[i], CurrentTime);
				}*/
				
				for (const KeyValue<int, Vector2> &E : xi.state) {
					Ref<InputEventScreenTouch> st;
					st.instantiate();
					st->set_index(E.key);
					st->set_window_id(window_id);
					st->set_position(E.value);
					Input::get_singleton()->parse_input_event(st);