Make conky not crash when drawing on root window
authorPavel Labath <pavelo@centrum.sk>
Tue, 19 Jan 2010 23:01:01 +0000 (00:01 +0100)
committerPavel Labath <pavelo@centrum.sk>
Tue, 19 Jan 2010 23:06:16 +0000 (00:06 +0100)
It was failing in XQueryColor because colourmap was NULL. This seemed to help.

src/x11.c

index 7892b96..fff366d 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -531,6 +531,8 @@ void init_window(int own_window, int w, int h, int set_trans, int back_colour,
                if (!window.window) {
                        window.window = find_desktop_window(&window.root, &window.desktop);
                }
+               window.visual = DefaultVisual(display, screen);
+               window.colourmap = DefaultColormap(display, screen);
 
                if (XGetWindowAttributes(display, window.window, &attrs)) {
                        window.width = attrs.width;