aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-30 20:22:47 +0100
committerDaniel Eklöf <daniel@ekloef.se>2020-11-30 20:22:47 +0100
commit5b934f20ce232923c2066fe06e14e6ce0f29c9e0 (patch)
treec29596e18f1ad4fde9345fd3d88604978b08bc33 /main.c
parent01a4b857dccdfc6e493ea531bd69bbf037cc718c (diff)
downloadwbg-5b934f20ce232923c2066fe06e14e6ce0f29c9e0.tar.gz
shm: use XRGB8888 instead of ARGB8888
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 10 insertions, 4 deletions
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);