### 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
}
					}
					if (desktop_valid) {
						use_simple_method = false;
						
						
						int (*oldHandler)(Display *, XErrorEvent *) = XSetErrorHandler(&bad_window_error_handler);
						for (unsigned long win_index = 0; win_index < clients_len; ++win_index) {
							g_bad_window = false;
							
							bool strut_found = false;
							unsigned long strut_len = 0;
							unsigned char *strut_data = nullptr;
							Atom strut_partial_prop = XInternAtom(x11_display, "_NET_WM_STRUT_PARTIAL", True);
							if (strut_partial_prop != None) {
								if (XGetWindowProperty(x11_display, windows_data[win_index], strut_partial_prop, 0, LONG_MAX, False, XA_CARDINAL, &type, &format, &strut_len, &remaining, &strut_data) == Success) {
									strut_found = true;
								}
							}
							
							if (!g_bad_window && !strut_found) {
								Atom strut_prop = XInternAtom(x11_display, "_NET_WM_STRUT", True);
								if (strut_prop != None) {
									if (XGetWindowProperty(x11_display, windows_data[win_index], strut_prop, 0, LONG_MAX, False, XA_CARDINAL, &type, &format, &strut_len, &remaining, &strut_data) == Success) {
										strut_found = true;
									}
								}
							}
							if (!g_bad_window && strut_found && (format == 32) && (strut_len >= 4) && strut_data) {
								long *struts = (long *)strut_data;