#ifdef XFT
#include <X11/Xft/Xft.h>
-int use_xft = 0;
+int use_xft;
#endif
#ifdef HAVE_XDBE
#ifdef USE_ARGB
int use_argb_visual;
-int own_window_argb_value;
int have_argb_visual;
#endif /* USE_ARGB */
+int own_window_argb_value;
/* some basic X11 stuff */
Display *display = NULL;
return win;
}
+static int colour_set = -1;
/* if no argb visual is configured sets background to ParentRelative for the Window and all parents,
else real transparency is used */
void set_transparent_background(Window win, int alpha)
{
- static int colour_set = -1;
(void)alpha; /* disable warnings when unused */
#ifdef USE_ARGB
*visual = visual_list[i].visual;
*depth = visual_list[i].depth;
DBGP("Found ARGB Visual");
+ XFree(visual_list);
return 1;
}
}
// no argb visual available
DBGP("No ARGB Visual found");
+ XFree(visual_list);
return 0;
}
#endif /* USE_ARGB */
XFreeGC(display, window.gc);
}
memset(&window, 0, sizeof(struct conky_window));
+ colour_set = -1;
}
void init_window(int own_window, int w, int h, int set_trans, int back_colour,
XClassHint classHint;
XWMHints wmHint;
Atom xa;
-
+
#ifdef USE_ARGB
if (have_argb_visual) {
attrs.colormap = window.colourmap;
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;
void update_x11info(void)
{
struct information *current_info = &info;
- if (!x_initialised == YES)
+ if (x_initialised != YES)
return;
current_info->x11.monitor.number = XScreenCount(display);
current_info->x11.monitor.current = XDefaultScreen(display);