### Godot version

2992ffd25523cb8b3e0ef1b873c40115b8940178

### System information

Windows 10

### Issue description

Godot crashes randomly within a few seconds after project start when moving with the mouse.

![win_err](https://github.com/godotengine/godot/assets/52464204/1da28596-d95b-40f3-b32f-12219ec02c5d)

Started after recent merge of https://github.com/godotengine/godot/pull/67791.
I can confirm that reverting the pr fixes the crashes.

### Steps to reproduce

see desc

### Minimal reproduction project

N/A
break;
							}
						}
					}
					if (window_id_other != INVALID_WINDOW_ID) {
						int x, y;
						Window child;
						XTranslateCoordinates(x11_display, wd.x11_window, wd_other_x11_window, event.xbutton.x, event.xbutton.y, &x, &y, &child);
						mb->set_window_id(window_id_other);
						mb->set_position(Vector2(x, y));
						mb->set_global_position(mb->get_position());
					}
				}
				Input::get_singleton()->parse_input_event(mb);
			} break;
			case MotionNotify: {
				if (ime_window_event || ignore_events) {
					break;
				}
				
				
				
				WindowID focused_window_id = _get_focused_window_or_popup();
				if (!windows.has(focused_window_id)) {
					focused_window_id = MAIN_WINDOW_ID;
				}
				while (true) {
					if (mouse_mode == MOUSE_MODE_CAPTURED && event.xmotion.x == windows[focused_window_id].size.width / 2 && event.xmotion.y == windows[focused_window_id].size.height / 2) {
						
						center = Vector2(event.xmotion.x, event.xmotion.y);