From 4b386667770e8ec7a31b938fc234cf5a73120d57 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 14 Mar 2010 22:24:03 +0100 Subject: [PATCH] Fix a couple of problems when compiling without OWN_WINDOW --- src/conky.cc | 11 ++++++----- src/x11.cc | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/conky.cc b/src/conky.cc index 96e7b4f8..54ce5b2f 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -1969,9 +1969,10 @@ static void main_loop(void) selected_font = 0; update_text_area(); +#if defined(OWN_WINDOW) || defined(BUILD_XDBE) long border_total = window.border_inner_margin + window.border_outer_margin + window.border_width; - +#endif #ifdef OWN_WINDOW if (own_window) { int changed = 0; @@ -2878,9 +2879,9 @@ static int do_config_step(int *line, FILE *fp, char *buf, char **name, char **va } #ifdef BUILD_X11 -void setalignment(int* text_alignment, unsigned int windowtype, const char* value, const char *f, int line, bool conffile) { +void setalignment(int* text_alignment, const char* value, const char *f, int line, bool conffile) { #ifdef OWN_WINDOW - if (windowtype == TYPE_DOCK) { + if (window.type == TYPE_DOCK) { NORM_ERR("alignment is disabled when own_window_type is dock"); } else #endif /*OWN_WINDOW */ @@ -2942,7 +2943,7 @@ char load_config_file(const char *f) } } CONF("alignment") { - setalignment(&text_alignment, window.type, value, f, line, true); + setalignment(&text_alignment, value, f, line, true); } CONF("background") { fork_to_background = string_to_bool(value); @@ -4074,7 +4075,7 @@ void initialisation(int argc, char **argv) { set_first_font(optarg); break; case 'a': - setalignment(&text_alignment, window.type, optarg, NULL, 0, false); + setalignment(&text_alignment, optarg, NULL, 0, false); break; #ifdef OWN_WINDOW diff --git a/src/x11.cc b/src/x11.cc index 8285b8b8..9f8f4020 100644 --- a/src/x11.cc +++ b/src/x11.cc @@ -266,6 +266,8 @@ void destroy_window(void) void init_window(int own_window, int w, int h, int set_trans, int back_colour, char **argv, int argc) { + // these vars are unused if OWN_WINDOW is not defined + (void)own_window; (void)w; (void)h; (void)argv; (void)argc; /* There seems to be some problems with setting transparent background * (on fluxbox this time). It doesn't happen always and I don't know why it * happens but I bet the bug is somewhere here. */