From 1178ca3c365ee8adfba7f2fd8792ccac9398621c Mon Sep 17 00:00:00 2001 From: Jens Nolte Date: Tue, 14 May 2024 22:54:34 +0200 Subject: [PATCH] Fix ShmClient crash on close request --- examples/ShmClient.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/ShmClient.hs b/examples/ShmClient.hs index a7c82fd..a423698 100644 --- a/examples/ShmClient.hs +++ b/examples/ShmClient.hs @@ -21,6 +21,7 @@ main = do traceIO "Connected" configurationVar <- newEmptyTMVarIO + closeRequestedVar <- newTVarIO False let properties = defaultWindowProperties { title = "quasar-wayland-example-client" @@ -28,7 +29,8 @@ main = do window <- atomicallyC do windowManager <- getClientWindowManager @ShmBufferBackend client - newWindow windowManager properties (writeTMVar configurationVar) undefined + newWindow windowManager properties (writeTMVar configurationVar) \case + WindowRequestClose -> writeTVar closeRequestedVar True forM_ [solidColor, gradient, gradient2, gradient3, gradient4] \img -> do -- Blocks until first configure event