### 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
nullptr,
		 (VkSurfaceTransformFlagBitsKHR)preTransform,
		 compositeAlpha,
		 window->presentMode,
		 true,
		 VK_NULL_HANDLE,
	};
	err = fpCreateSwapchainKHR(device, &swapchain_ci, nullptr, &window->swapchain);
	ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
	uint32_t sp_image_count;
	err = fpGetSwapchainImagesKHR(device, window->swapchain, &sp_image_count, nullptr);
	ERR_FAIL_COND_V(err, ERR_CANT_CREATE);
	if (swapchainImageCount == 0) {
		
		swapchainImageCount = sp_image_count;
	} else {
		ERR_FAIL_COND_V(swapchainImageCount != sp_image_count, ERR_BUG);
	}
	VkImage *swapchainImages = (VkImage *)malloc(swapchainImageCount * sizeof(VkImage));
	ERR_FAIL_COND_V(!swapchainImages, ERR_CANT_CREATE);
	err = fpGetSwapchainImagesKHR(device, window->swapchain, &swapchainImageCount, swapchainImages);
	if (err) {
		free(swapchainImages);
		ERR_FAIL_V(ERR_CANT_CREATE);
	}
	window->swapchain_image_resources =
			(SwapchainImageResources *)malloc(sizeof(SwapchainImageResources) * swapchainImageCount);
	if (!window->swapchain_image_resources) {
		free(swapchainImages);
		ERR_FAIL_V(ERR_CANT_CREATE);