aboutsummaryrefslogtreecommitdiff
path: root/src/wl_window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wl_window.c')
-rw-r--r--src/wl_window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wl_window.c b/src/wl_window.c
index b5aac22..021d9aa 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -4,12 +4,13 @@
#include <assert.h>
#include <fcntl.h>
+#include <limits.h>
#include <poll.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/mman.h>
+#include <unistd.h>
#include <wayland-client.h>
#include <wayland-egl.h>
@@ -687,6 +688,9 @@ static void shutdown_wayland(struct imv_window *window)
struct imv_window *imv_window_create(int width, int height, const char *title)
{
+ /* Ensure event writes will always be atomic */
+ assert(sizeof(struct imv_event) <= PIPE_BUF);
+
struct imv_window *window = calloc(1, sizeof *window);
window->scale = 1;
window->wl_outputs = list_create();