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

::Time threshold = ABSDIFF(peek_event.xkey.time, xkeyevent->time);
#undef ABSDIFF
			if (peek_event.type == KeyPress && threshold < 5) {
				KeySym rk;
				XLookupString((XKeyEvent *)&peek_event, str, 256, &rk, nullptr);
				if (rk == keysym_keycode) {
					
					++p_event_index;
					_handle_key_event(p_window, (XKeyEvent *)&peek_event, p_events, p_event_index, true);
					return; 
				}
			}
			
		}
		
	}
	
	k->set_pressed(keypress);
	if (keycode >= Key::A + 32 && keycode <= Key::Z + 32) {
		keycode -= int('a' - 'A');
	}
	k->set_keycode(keycode);
	k->set_physical_keycode((Key)physical_keycode);
	if (!keysym.is_empty()) {
		k->set_key_label(fix_key_label(keysym[0], keycode));
	} else {
		k->set_key_label(keycode);
	}
	if (keypress) {
		k->set_unicode(fix_unicode(unicode));