diff --git a/src/conky.cc b/src/conky.cc index c7a0a177..3362577e 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2575,7 +2575,6 @@ static void set_default_configurations(void) window.type = TYPE_NORMAL; window.hints = 0; #ifdef BUILD_ARGB - use_argb_visual = 0; own_window_argb_value = 255; #endif #endif @@ -3298,9 +3297,6 @@ char load_config_file(const char *f) } } #ifdef BUILD_ARGB - CONF("own_window_argb_visual") { - use_argb_visual = string_to_bool(value); - } CONF("own_window_argb_value") { own_window_argb_value = strtol(value, 0, 0); if (own_window_argb_value > 255 || own_window_argb_value < 0) { diff --git a/src/x11.cc b/src/x11.cc index a6ae772b..763d735a 100644 --- a/src/x11.cc +++ b/src/x11.cc @@ -52,8 +52,7 @@ int use_xdbe; #endif #ifdef BUILD_ARGB -int use_argb_visual; -int have_argb_visual; +bool have_argb_visual; #endif /* BUILD_ARGB */ int own_window_argb_value; @@ -283,8 +282,8 @@ void init_window(int w, int h, int set_trans, int back_colour, } #ifdef BUILD_ARGB - if (use_argb_visual && get_argb_visual(&visual, &depth)) { - have_argb_visual = 1; + if (use_argb_visual.get(*state) && get_argb_visual(&visual, &depth)) { + have_argb_visual = true; window.visual = visual; window.colourmap = XCreateColormap(display, DefaultRootWindow(display), window.visual, AllocNone); @@ -948,4 +947,9 @@ namespace { } conky::config_setting own_window_title("own_window_title", conky::simple_accessors(PACKAGE_NAME " (" + gethostnamecxx()+")", false)); + +#ifdef BUILD_ARGB +conky::config_setting use_argb_visual("own_window_argb_visual", + conky::simple_accessors(false, false)); #endif +#endif /*OWN_WINDOW*/ diff --git a/src/x11.h b/src/x11.h index 40a3c40e..9568f694 100644 --- a/src/x11.h +++ b/src/x11.h @@ -99,10 +99,8 @@ extern int use_xft; #endif #if defined(BUILD_ARGB) && defined(OWN_WINDOW) -/* 1 if config var set to 1, otherwise 0 */ -extern int use_argb_visual; -/* 1 if use_argb_visual=1 and argb visual was found, otherwise 0 */ -extern int have_argb_visual; +/* true if use_argb_visual=true and argb visual was found*/ +extern bool have_argb_visual; #endif /* range of 0-255 for alpha */ extern int own_window_argb_value; @@ -158,7 +156,10 @@ extern conky::config_setting out_to_x; extern conky::config_setting own_window; extern conky::config_setting own_window_class; extern conky::config_setting own_window_title; +#ifdef BUILD_ARGB +extern conky::config_setting use_argb_visual; #endif +#endif /*OWN_WINDOW*/ #endif /*X11_H_*/ #endif /* BUILD_X11 */