### Godot version

 Latest 4.0.dev (a3a42159e31db27f8ae7c1ecad6a9ed417cb05de)

### System information

Ubuntu 22.04.1 LTS

### Issue description

![image](https://user-images.githubusercontent.com/85438892/214476911-0ce83a43-b959-4b13-88fd-d6b9af0cd63a.png)

### Steps to reproduce

Open any script

### Minimal reproduction project

N/A
XVisualInfo visualInfo;
	bool vi_selected = false;
#ifdef GLES3_ENABLED
	if (gl_manager) {
		visualInfo = gl_manager->get_vi(x11_display);
		vi_selected = true;
	}
#endif
	if (!vi_selected) {
		long visualMask = VisualScreenMask;
		int numberOfVisuals;
		XVisualInfo vInfoTemplate = {};
		vInfoTemplate.screen = DefaultScreen(x11_display);
		XVisualInfo *vi_list = XGetVisualInfo(x11_display, visualMask, &vInfoTemplate, &numberOfVisuals);
		ERR_FAIL_COND_V(!vi_list, INVALID_WINDOW_ID);
		visualInfo = vi_list[0];
		if (OS::get_singleton()->is_layered_allowed()) {
			for (int i = 0; i < numberOfVisuals; i++) {
				XRenderPictFormat *pict_format = XRenderFindVisualFormat(x11_display, vi_list[i].visual);
				if (!pict_format) {
					continue;
				}
				visualInfo = vi_list[i];