mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
make own_window_argb_visual a lua setting
This commit is contained in:
parent
1960a511fd
commit
94be4f6eb9
@ -2575,7 +2575,6 @@ static void set_default_configurations(void)
|
|||||||
window.type = TYPE_NORMAL;
|
window.type = TYPE_NORMAL;
|
||||||
window.hints = 0;
|
window.hints = 0;
|
||||||
#ifdef BUILD_ARGB
|
#ifdef BUILD_ARGB
|
||||||
use_argb_visual = 0;
|
|
||||||
own_window_argb_value = 255;
|
own_window_argb_value = 255;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -3298,9 +3297,6 @@ char load_config_file(const char *f)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef BUILD_ARGB
|
#ifdef BUILD_ARGB
|
||||||
CONF("own_window_argb_visual") {
|
|
||||||
use_argb_visual = string_to_bool(value);
|
|
||||||
}
|
|
||||||
CONF("own_window_argb_value") {
|
CONF("own_window_argb_value") {
|
||||||
own_window_argb_value = strtol(value, 0, 0);
|
own_window_argb_value = strtol(value, 0, 0);
|
||||||
if (own_window_argb_value > 255 || own_window_argb_value < 0) {
|
if (own_window_argb_value > 255 || own_window_argb_value < 0) {
|
||||||
|
12
src/x11.cc
12
src/x11.cc
@ -52,8 +52,7 @@ int use_xdbe;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BUILD_ARGB
|
#ifdef BUILD_ARGB
|
||||||
int use_argb_visual;
|
bool have_argb_visual;
|
||||||
int have_argb_visual;
|
|
||||||
#endif /* BUILD_ARGB */
|
#endif /* BUILD_ARGB */
|
||||||
int own_window_argb_value;
|
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
|
#ifdef BUILD_ARGB
|
||||||
if (use_argb_visual && get_argb_visual(&visual, &depth)) {
|
if (use_argb_visual.get(*state) && get_argb_visual(&visual, &depth)) {
|
||||||
have_argb_visual = 1;
|
have_argb_visual = true;
|
||||||
window.visual = visual;
|
window.visual = visual;
|
||||||
window.colourmap = XCreateColormap(display,
|
window.colourmap = XCreateColormap(display,
|
||||||
DefaultRootWindow(display), window.visual, AllocNone);
|
DefaultRootWindow(display), window.visual, AllocNone);
|
||||||
@ -948,4 +947,9 @@ namespace {
|
|||||||
}
|
}
|
||||||
conky::config_setting<std::string> own_window_title("own_window_title",
|
conky::config_setting<std::string> own_window_title("own_window_title",
|
||||||
conky::simple_accessors<std::string>(PACKAGE_NAME " (" + gethostnamecxx()+")", false));
|
conky::simple_accessors<std::string>(PACKAGE_NAME " (" + gethostnamecxx()+")", false));
|
||||||
|
|
||||||
|
#ifdef BUILD_ARGB
|
||||||
|
conky::config_setting<bool> use_argb_visual("own_window_argb_visual",
|
||||||
|
conky::simple_accessors<bool>(false, false));
|
||||||
#endif
|
#endif
|
||||||
|
#endif /*OWN_WINDOW*/
|
||||||
|
@ -99,10 +99,8 @@ extern int use_xft;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUILD_ARGB) && defined(OWN_WINDOW)
|
#if defined(BUILD_ARGB) && defined(OWN_WINDOW)
|
||||||
/* 1 if config var set to 1, otherwise 0 */
|
/* true if use_argb_visual=true and argb visual was found*/
|
||||||
extern int use_argb_visual;
|
extern bool have_argb_visual;
|
||||||
/* 1 if use_argb_visual=1 and argb visual was found, otherwise 0 */
|
|
||||||
extern int have_argb_visual;
|
|
||||||
#endif
|
#endif
|
||||||
/* range of 0-255 for alpha */
|
/* range of 0-255 for alpha */
|
||||||
extern int own_window_argb_value;
|
extern int own_window_argb_value;
|
||||||
@ -158,7 +156,10 @@ extern conky::config_setting<bool> out_to_x;
|
|||||||
extern conky::config_setting<bool> own_window;
|
extern conky::config_setting<bool> own_window;
|
||||||
extern conky::config_setting<std::string> own_window_class;
|
extern conky::config_setting<std::string> own_window_class;
|
||||||
extern conky::config_setting<std::string> own_window_title;
|
extern conky::config_setting<std::string> own_window_title;
|
||||||
|
#ifdef BUILD_ARGB
|
||||||
|
extern conky::config_setting<bool> use_argb_visual;
|
||||||
#endif
|
#endif
|
||||||
|
#endif /*OWN_WINDOW*/
|
||||||
|
|
||||||
#endif /*X11_H_*/
|
#endif /*X11_H_*/
|
||||||
#endif /* BUILD_X11 */
|
#endif /* BUILD_X11 */
|
||||||
|
Loading…
Reference in New Issue
Block a user