summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_wsi_x11.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-28 20:17:00 -0700
committerJason Ekstrand <[email protected]>2015-09-28 20:18:41 -0700
commit337caee91078e3d83ff01b929a44a74600cde6a7 (patch)
tree4df752dcf30b1a8bb2c965693a95575aef6252e9 /src/vulkan/anv_wsi_x11.c
parentf06bc45b0c487227649e4083195361ed55525b91 (diff)
anv/wsi_x11: Properly report BadDrawable errors to the client
Diffstat (limited to 'src/vulkan/anv_wsi_x11.c')
-rw-r--r--src/vulkan/anv_wsi_x11.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vulkan/anv_wsi_x11.c b/src/vulkan/anv_wsi_x11.c
index f481a017001..e5d0a2572aa 100644
--- a/src/vulkan/anv_wsi_x11.c
+++ b/src/vulkan/anv_wsi_x11.c
@@ -73,8 +73,18 @@ x11_get_surface_info(struct anv_wsi_implementation *impl,
xcb_window_t win = (xcb_window_t)(uintptr_t)vk_window->pPlatformWindow;
xcb_get_geometry_cookie_t cookie = xcb_get_geometry(conn, win);
+ xcb_generic_error_t *err;
xcb_get_geometry_reply_t *geom = xcb_get_geometry_reply(conn, cookie,
- NULL);
+ &err);
+ if (!geom) {
+ if (err->error_code == XCB_DRAWABLE) {
+ return vk_error(VK_ERROR_INVALID_HANDLE);
+ } else {
+ return vk_error(VK_ERROR_UNKNOWN);
+ }
+ free(err);
+ }
+
VkExtent2D extent = { geom->width, geom->height };
free(geom);