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

MouseButtonMask mask = mouse_button_to_mask(p_x11_button);
	if (p_x11_type == ButtonPress) {
		last_button_state.set_flag(mask);
	} else {
		last_button_state.clear_flag(mask);
	}
	return last_button_state;
}
void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo) {
	WindowData wd = windows[p_window];
	
	XKeyEvent *xkeyevent = p_event;
	if (wd.ime_in_progress) {
		return;
	}
	if (wd.ime_suppress_next_keyup) {
		wd.ime_suppress_next_keyup = false;
		if (xkeyevent->type != KeyPress) {
			return;
		}
	}