### 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
switch (p_screen) {
		case SCREEN_PRIMARY: {
			p_screen = get_primary_screen();
		} break;
		case SCREEN_OF_MAIN_WINDOW: {
			p_screen = window_get_current_screen(MAIN_WINDOW_ID);
		} break;
		default:
			break;
	}
	int screen_count = get_screen_count();
	
	ERR_FAIL_INDEX_V(p_screen, screen_count, Rect2i(0, 0, 0, 0));
	bool is_multiscreen = screen_count > 1;
	
	Rect2i rect = _screen_get_rect(p_screen);
	
	
	int x11_screen_count = ScreenCount(x11_display);
	Window x11_window = RootWindow(x11_display, p_screen < x11_screen_count ? p_screen : 0);
	Atom type;
	int format = 0;
	unsigned long remaining = 0;
	
	unsigned int desktop_index = 0;
	Atom desktop_prop = XInternAtom(x11_display, "_NET_CURRENT_DESKTOP", True);
	if (desktop_prop != None) {
		unsigned long desktop_len = 0;
		unsigned char *desktop_data = nullptr;
		if (XGetWindowProperty(x11_display, x11_window, desktop_prop, 0, LONG_MAX, False, XA_CARDINAL, &type, &format, &desktop_len, &remaining, &desktop_data) == Success) {