diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index e05ed58acc2..278d9ace085 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -605,20 +605,11 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface, caps->currentExtent = extent; caps->minImageExtent = extent; caps->maxImageExtent = extent; - } else { - /* This can happen if the client didn't wait for the configure event - * to come back from the compositor. In that case, we don't know the - * size of the window so we just return valid "I don't know" stuff. - */ - caps->currentExtent = (VkExtent2D) { UINT32_MAX, UINT32_MAX }; - caps->minImageExtent = (VkExtent2D) { 1, 1 }; - caps->maxImageExtent = (VkExtent2D) { - wsi_device->maxImageDimension2D, - wsi_device->maxImageDimension2D, - }; } free(err); free(geom); + if (!geom) + return VK_ERROR_SURFACE_LOST_KHR; if (visual_has_alpha(visual, visual_depth)) { caps->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR | @@ -657,6 +648,9 @@ x11_surface_get_capabilities2(VkIcdSurfaceBase *icd_surface, x11_surface_get_capabilities(icd_surface, wsi_device, &caps->surfaceCapabilities); + if (result != VK_SUCCESS) + return result; + vk_foreach_struct(ext, caps->pNext) { switch (ext->sType) { case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: { @@ -772,17 +766,10 @@ x11_surface_get_present_rectangles(VkIcdSurfaceBase *icd_surface, .offset = { 0, 0 }, .extent = { geom->width, geom->height }, }; - } else { - /* This can happen if the client didn't wait for the configure event - * to come back from the compositor. In that case, we don't know the - * size of the window so we just return valid "I don't know" stuff. - */ - *rect = (VkRect2D) { - .offset = { 0, 0 }, - .extent = { UINT32_MAX, UINT32_MAX }, - }; } free(geom); + if (!geom) + return VK_ERROR_SURFACE_LOST_KHR; } return vk_outarray_status(&out);