From 3173a4f353f990e96a49e5a24f0d8cf57b21176c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 20 Apr 2021 17:26:39 +0200 Subject: [PATCH] Use cairo_image_surface_get_stride instead of guessing it --- sway/tree/container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/tree/container.c b/sway/tree/container.c index 47772b62..438ff157 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -554,7 +554,7 @@ static void update_title_texture(struct sway_container *con, cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); - int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); + int stride = cairo_image_surface_get_stride(surface); struct wlr_renderer *renderer = wlr_backend_get_renderer( output->wlr_output->backend); *texture = wlr_texture_from_pixels( @@ -1639,7 +1639,7 @@ static void update_marks_texture(struct sway_container *con, cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); - int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); + int stride = cairo_image_surface_get_stride(surface); struct wlr_renderer *renderer = wlr_backend_get_renderer( output->wlr_output->backend); *texture = wlr_texture_from_pixels(