From 807f93f8144592ab771c7babc684d732355a529e Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 3 Jun 2012 16:20:17 +0200 Subject: [PATCH] Fix `using "draw_shades yes" lua script runs twice per update' (sf.net #3524540) bugreported by arclance --- src/conky.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/conky.c b/src/conky.c index 88006fcf..df4e6feb 100644 --- a/src/conky.c +++ b/src/conky.c @@ -3321,9 +3321,6 @@ static int draw_line(char *s, int special_index) static void draw_text(void) { #ifdef X11 -#ifdef HAVE_LUA - llua_draw_pre_hook(); -#endif /* HAVE_LUA */ if (output_methods & TO_X) { cur_y = text_start_y; @@ -3355,9 +3352,6 @@ static void draw_text(void) attron(COLOR_PAIR(COLOR_WHITE)); #endif /* NCURSES */ for_each_line(text_buffer, draw_line); -#if defined(HAVE_LUA) && defined(X11) - llua_draw_post_hook(); -#endif /* HAVE_LUA */ } static void draw_stuff(void) @@ -3375,6 +3369,9 @@ static void draw_stuff(void) if(!append_fpointer) NORM_ERR("Can't append '%s' anymore", append_file); } +#ifdef HAVE_LUA + llua_draw_pre_hook(); +#endif /* HAVE_LUA */ #ifdef X11 if (output_methods & TO_X) { selected_font = 0; @@ -3413,6 +3410,9 @@ static void draw_stuff(void) #endif /* X11 */ draw_mode = FG; draw_text(); +#ifdef HAVE_LUA + llua_draw_post_hook(); +#endif /* HAVE_LUA */ #if defined(X11) && defined(HAVE_XDBE) if (output_methods & TO_X) { xdbe_swap_buffers();