### Godot version

Latest 4.0.dev (a3a42159e31db27f8ae7c1ecad6a9ed417cb05de)

### System information

Ubuntu 22.04.1 LTS

### Issue description

Ctrl+Shift+F (Find in Files) in the text editor, for example, causes my laptop to freeze consistently. I also reproduced it with F1 and Ctrl+Shift+R, as well as by using the dropdown instead of shortcuts.

### Steps to reproduce

Trivial

### Minimal reproduction project

N/A
} break;
			case EnterNotify: {
				DEBUG_LOG_X11("[%u] EnterNotify window=%lu (%u), mode='%u' \n", frame, event.xcrossing.window, window_id, event.xcrossing.mode);
				if (ime_window_event) {
					break;
				}
				if (!mouse_mode_grab) {
					_send_window_event(windows[window_id], WINDOW_EVENT_MOUSE_ENTER);
				}
			} break;
			case FocusIn: {
				DEBUG_LOG_X11("[%u] FocusIn window=%lu (%u), mode='%u' \n", frame, event.xfocus.window, window_id, event.xfocus.mode);
				if (ime_window_event) {
					break;
				}
				WindowData &wd = windows[window_id];
				last_focused_window = window_id;
				wd.focused = true;
				
				static unsigned int focus_order = 0;
				wd.focus_order = ++focus_order;
				_send_window_event(wd, WINDOW_EVENT_FOCUS_IN);
				if (mouse_mode_grab) {
					
					for (const KeyValue<WindowID, WindowData> &E : windows) {
						if (mouse_mode == MOUSE_MODE_CONFINED) {
							XUndefineCursor(x11_display, E.value.x11_window);
						} else if (mouse_mode == MOUSE_MODE_CAPTURED || mouse_mode == MOUSE_MODE_CONFINED_HIDDEN) { 
							XDefineCursor(x11_display, E.value.x11_window, null_cursor);
						}