### Godot version

 Latest 4.0.dev (a3a42159e31db27f8ae7c1ecad6a9ed417cb05de)

### System information

Ubuntu 22.04.1 LTS

### Issue description

![image](https://user-images.githubusercontent.com/85438892/214476911-0ce83a43-b959-4b13-88fd-d6b9af0cd63a.png)

### Steps to reproduce

Open any script

### Minimal reproduction project

N/A
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;
		}
	}