From 6030ef52981490eab1797c534818437491bff2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 3 Mar 2019 12:56:13 +0100 Subject: [PATCH] bar/wayland: use cairo_format_stride_for_width() to calculate stride --- bar/wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bar/wayland.c b/bar/wayland.c index e9ede69..54b6006 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -466,7 +466,8 @@ get_buffer(struct wayland_backend *backend) } /* Total size */ - uint32_t stride = backend->width * 4; + const uint32_t stride = cairo_format_stride_for_width( + CAIRO_FORMAT_ARGB32, backend->width); size = stride * backend->height; ftruncate(pool_fd, size);