diff --git a/lib/libstuff/x11/colors/parsecolor.c b/lib/libstuff/x11/colors/parsecolor.c index 7cd87641..69e9addb 100644 --- a/lib/libstuff/x11/colors/parsecolor.c +++ b/lib/libstuff/x11/colors/parsecolor.c @@ -7,7 +7,7 @@ ulong pixelvalue(Window *w, Color *c) { XColor xc; - if(w->visual->class != TrueColor) { + if(w->visual == nil || w->visual->class != TrueColor) { if(c->pixel != ~0UL) return c->pixel; xc.red = c->red; diff --git a/lib/libstuff/x11/initdisplay.c b/lib/libstuff/x11/initdisplay.c index 9e5d719c..b8a21789 100644 --- a/lib/libstuff/x11/initdisplay.c +++ b/lib/libstuff/x11/initdisplay.c @@ -68,6 +68,7 @@ initdisplay(void) { scr.depth = DefaultDepth(display, scr.screen); scr.root.xid = RootWindow(display, scr.screen); + scr.root.visual = scr.visual; scr.root.r = Rect(0, 0, DisplayWidth(display, scr.screen), DisplayHeight(display, scr.screen));