1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

Bugfix: "out_to_x no" was ignored when in a file included with ${include path_to_file}

This commit is contained in:
Nikolas Garofil 2010-04-14 21:50:50 +02:00
parent f5c147b160
commit 5ddf751345

View File

@ -2392,6 +2392,31 @@ void free_specials(special_t *current) {
} }
} }
#ifdef BUILD_X11
void clean_up_x11() {
if(window_created == 1) {
long border_total = window.border_inner_margin
+ window.border_outer_margin + window.border_width;
XClearArea(display, window.window, text_start_x - border_total,
text_start_y - border_total, text_width + 2*border_total,
text_height + 2*border_total, 0);
}
destroy_window();
free_fonts();
if(x11_stuff.region) {
XDestroyRegion(x11_stuff.region);
x11_stuff.region = NULL;
}
if(display) {
XCloseDisplay(display);
display = NULL;
}
free_and_zero(info.x11.desktop.all_names);
free_and_zero(info.x11.desktop.name);
x_initialised = NO;
}
#endif
void clean_up(void *memtofree1, void* memtofree2) void clean_up(void *memtofree1, void* memtofree2)
{ {
free_update_callbacks(); free_update_callbacks();
@ -2410,30 +2435,13 @@ void clean_up(void *memtofree1, void* memtofree2)
free_and_zero(info.cpu_usage); free_and_zero(info.cpu_usage);
#ifdef BUILD_X11 #ifdef BUILD_X11
if (x_initialised == YES) { if (x_initialised == YES) {
if(window_created == 1) { clean_up_x11();
long border_total = window.border_inner_margin
+ window.border_outer_margin + window.border_width;
XClearArea(display, window.window, text_start_x - border_total,
text_start_y - border_total, text_width + 2*border_total,
text_height + 2*border_total, 0);
}
destroy_window();
free_fonts();
if(x11_stuff.region) {
XDestroyRegion(x11_stuff.region);
x11_stuff.region = NULL;
}
XCloseDisplay(display);
display = NULL;
free_and_zero(info.x11.desktop.all_names);
free_and_zero(info.x11.desktop.name);
x_initialised = NO;
}else{ }else{
free(fonts); //in set_default_configurations a font is set but not loaded free(fonts); //in set_default_configurations a font is set but not loaded
font_count = -1; font_count = -1;
} }
#endif /* BUILD_X11 */ #endif
free_templates(); free_templates();
@ -2936,17 +2944,14 @@ char load_config_file(const char *f)
#ifdef BUILD_X11 #ifdef BUILD_X11
CONF2("out_to_x") { CONF2("out_to_x") {
/* don't listen if X is already initialised or
* if we already know we don't want it */
if(x_initialised != YES) {
if (string_to_bool(value)) { if (string_to_bool(value)) {
output_methods &= TO_X; output_methods &= TO_X;
} else { } else {
clean_up_x11();
output_methods &= ~TO_X; output_methods &= ~TO_X;
x_initialised = NEVER; x_initialised = NEVER;
} }
} }
}
CONF("display") { CONF("display") {
if (!value || x_initialised == YES) { if (!value || x_initialised == YES) {
CONF_ERR; CONF_ERR;