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

preedit_start_callback.client_data = (::XPointer)(this);
				preedit_start_callback.callback = (::XIMProc)(void *)(_xim_preedit_start_callback);
				::XIMCallback preedit_done_callback;
				preedit_done_callback.client_data = (::XPointer)(this);
				preedit_done_callback.callback = (::XIMProc)(_xim_preedit_done_callback);
				::XIMCallback preedit_draw_callback;
				preedit_draw_callback.client_data = (::XPointer)(this);
				preedit_draw_callback.callback = (::XIMProc)(_xim_preedit_draw_callback);
				::XIMCallback preedit_caret_callback;
				preedit_caret_callback.client_data = (::XPointer)(this);
				preedit_caret_callback.callback = (::XIMProc)(_xim_preedit_caret_callback);
				::XVaNestedList preedit_attributes = XVaCreateNestedList(0,
						XNPreeditStartCallback, &preedit_start_callback,
						XNPreeditDoneCallback, &preedit_done_callback,
						XNPreeditDrawCallback, &preedit_draw_callback,
						XNPreeditCaretCallback, &preedit_caret_callback,
						(char *)nullptr);
				wd.xic = XCreateIC(xim,
						XNInputStyle, xim_style,
						XNClientWindow, wd.x11_xim_window,
						XNFocusWindow, wd.x11_xim_window,
						XNPreeditAttributes, preedit_attributes,
						(char *)nullptr);
				XFree(preedit_attributes);
			} else {
				wd.xic = XCreateIC(xim,
						XNInputStyle, xim_style,
						XNClientWindow, wd.x11_xim_window,
						XNFocusWindow, wd.x11_xim_window,
						(char *)nullptr);