From 5b934f20ce232923c2066fe06e14e6ce0f29c9e0 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 30 Nov 2020 20:22:47 +0100 Subject: shm: use XRGB8888 instead of ARGB8888 --- main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d9c9dfa..7bdffe6 100644 --- a/main.c +++ b/main.c @@ -37,7 +37,7 @@ static struct wl_compositor *compositor; static struct wl_shm *shm; static struct zwlr_layer_shell_v1 *layer_shell; -static bool have_argb8888 = false; +static bool have_xrgb8888 = false; /* TODO: one per output */ static pixman_image_t *image; @@ -205,8 +205,8 @@ static const struct wl_output_listener output_listener = { static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { - if (format == WL_SHM_FORMAT_ARGB8888) - have_argb8888 = true; + if (format == WL_SHM_FORMAT_XRGB8888) + have_xrgb8888 = true; } static const struct wl_shm_listener shm_listener = { @@ -358,7 +358,11 @@ main(int argc, const char *const *argv) assert(layer_shell != NULL); wl_display_roundtrip(display); - assert(have_argb8888); + + if (!have_xrgb8888) { + LOG_ERR("shm: XRGB image format not available"); + goto out; + } sigset_t mask; sigemptyset(&mask); @@ -420,6 +424,8 @@ main(int argc, const char *const *argv) } } +out: + if (sig_fd >= 0) close(sig_fd); -- cgit v1.2.3