diff --git a/src/main.c b/src/main.c index 559948f..e2d3b24 100644 --- a/src/main.c +++ b/src/main.c @@ -269,10 +269,12 @@ void SetupEnvironment(WScreen * scr) strcat(tmp, buf); putenv(tmp); } - tmp = wmalloc(60); - snprintf(tmp, 60, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen, - scr->rcontext->attribs->colors_per_channel); - putenv(tmp); + if (scr->rcontext) { /* Wayland: rcontext is NULL (no X11 colormap) */ + tmp = wmalloc(60); + snprintf(tmp, 60, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen, + scr->rcontext->attribs->colors_per_channel); + putenv(tmp); + } } typedef struct {