mirror of
https://github.com/0intro/wmii
synced 2024-11-21 21:31:33 +03:00
Make sure a window has a visual before dereferencing it. Fixes issue #195.
This commit is contained in:
parent
0855f12de8
commit
2177aed027
@ -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;
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user