### 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
ERR_FAIL_COND_V(!windows.has(p_window), 0);
	switch (p_handle_type) {
		case DISPLAY_HANDLE: {
			return (int64_t)x11_display;
		}
		case WINDOW_HANDLE: {
			return (int64_t)windows[p_window].x11_window;
		}
		case WINDOW_VIEW: {
			return 0; 
		}
#ifdef GLES3_ENABLED
		case OPENGL_CONTEXT: {
			if (gl_manager) {
				return (int64_t)gl_manager->get_glx_context(p_window);
			}
			return 0;
		}
#endif
		default: {
			return 0;
		}
	}
}
void DisplayServerX11::window_attach_instance_id(ObjectID p_instance, WindowID p_window) {
	ERR_FAIL_COND(!windows.has(p_window));
	WindowData &wd = windows[p_window];
	wd.instance_id = p_instance;
}
ObjectID DisplayServerX11::window_get_attached_instance_id(WindowID p_window) const {