aboutsummaryrefslogtreecommitdiff
path: root/cube/cube.cpp
diff options
context:
space:
mode:
authorziga-lunarg <ziga@lunarg.com>2025-09-20 16:17:33 +0300
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>2025-09-20 12:53:35 -0600
commitf5f5add52941db500e84c01d40ebd4cda986e43f (patch)
tree3d6a6cc0b31be60fd585a1b6dbcea2c4024ad9d9 /cube/cube.cpp
parent95cfb8b1ba7fbcbe1383302ff286808c34e1fb9e (diff)
downloadusermoji-f5f5add52941db500e84c01d40ebd4cda986e43f.tar.xz
cube: Fix xlib window close
XSetVMProtocols is needed to register WM_DELETE_WINDOW. Without this the window close event was never received. The window was still destroyed and vkAcquireNextImageKHR returned VK_ERROR_SURFACE_LOST_KHR
Diffstat (limited to 'cube/cube.cpp')
-rw-r--r--cube/cube.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/cube/cube.cpp b/cube/cube.cpp
index bad2cccb..7f4b45d2 100644
--- a/cube/cube.cpp
+++ b/cube/cube.cpp
@@ -3224,6 +3224,7 @@ void Demo::create_window<WsiPlatform::xlib>() {
XMapWindow(xlib_display, xlib_window);
XFlush(xlib_display);
xlib_wm_delete_window = XInternAtom(xlib_display, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(xlib_display, xlib_window, &xlib_wm_delete_window, 1);
}
void Demo::handle_xlib_event(const XEvent *event) {