### Godot version

v4.0.3.stable.official [5222a99f5]

### System information

Windows 11, AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx     2.10 GHz

### Issue description

  The editor crashes when it is minimised if it isn't the foreground window, eg. via Windows key + M.  This didn't occur in 4.0.2, but is now occurring in 4.0.3. I'll just mention that /interface/editor/save_on_focus_loss is false because another issue mentions something like this but with that property set to true.

### Steps to reproduce

N/A

### Minimal reproduction project

N/A
GET_DEVICE_PROC_ADDR(device, GetPastPresentationTimingGOOGLE);
	}
	vkGetDeviceQueue(device, graphics_queue_family_index, 0, &graphics_queue);
	if (!separate_present_queue) {
		present_queue = graphics_queue;
	} else {
		vkGetDeviceQueue(device, present_queue_family_index, 0, &present_queue);
	}
	
	uint32_t formatCount;
	VkResult err = fpGetPhysicalDeviceSurfaceFormatsKHR(gpu, p_surface, &formatCount, nullptr);
	ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
	VkSurfaceFormatKHR *surfFormats = (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
	err = fpGetPhysicalDeviceSurfaceFormatsKHR(gpu, p_surface, &formatCount, surfFormats);
	if (err) {
		free(surfFormats);
		ERR_FAIL_V(ERR_CANT_CREATE);
	}
	
	
	
	if (formatCount == 1 && surfFormats[0].format == VK_FORMAT_UNDEFINED) {
		format = VK_FORMAT_B8G8R8A8_UNORM;
		color_space = surfFormats[0].colorSpace;
	} else {
		
		
		const VkFormat allowed_formats[] = {
			VK_FORMAT_B8G8R8A8_UNORM,
			VK_FORMAT_R8G8B8A8_UNORM