### 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
rect = workarea_rect;
					} else if (rect.intersects(workarea_rect)) {
						rect = rect.intersection(workarea_rect);
					}
				}
			}
			if (workarea_data) {
				XFree(workarea_data);
			}
		}
	}
	return rect;
}
int DisplayServerX11::screen_get_dpi(int p_screen) const {
	_THREAD_SAFE_METHOD_
	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;
	}
	
	ERR_FAIL_INDEX_V(p_screen, get_screen_count(), 0);
	
	Size2i sc = screen_get_size(p_screen);
	if (xrandr_ext_ok) {