From 2380a1fb1758aa037f91d3b9b9f56c498924a90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tin=20=C5=A0vagelj?= Date: Sat, 6 Apr 2024 14:51:40 +0200 Subject: [PATCH] Fix render order in draw_stuff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre draw hook is expected to run before anything else, so I moved imlib i.e. ${image} rendering after it. Signed-off-by: Tin Å vagelj --- src/conky.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/conky.cc b/src/conky.cc index 37b41de3e..cf27e3fcb 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -1592,15 +1592,16 @@ static void draw_text() { } void draw_stuff() { + for (auto output : display_outputs()) output->begin_draw_stuff(); + #ifdef BUILD_GUI - text_offset_x = text_offset_y = 0; + llua_draw_pre_hook(); + #ifdef BUILD_IMLIB2 + text_offset_x = text_offset_y = 0; cimlib_render(text_start_x, text_start_y, window.width, window.height); #endif /* BUILD_IMLIB2 */ -#endif /* BUILD_GUI */ - for (auto output : display_outputs()) output->begin_draw_stuff(); -#ifdef BUILD_GUI - llua_draw_pre_hook(); + for (auto output : display_outputs()) { if (!output->graphical()) continue; // XXX: we assume a single graphical display @@ -1633,12 +1634,16 @@ void draw_stuff() { set_foreground_color(default_color.get(*state)); unset_display_output(); } + #endif /* BUILD_GUI */ + // always draw text draw_mode = FG; draw_text(); -#if defined(BUILD_GUI) +#ifdef BUILD_GUI + llua_draw_post_hook(); #endif /* BUILD_GUI */ + for (auto output : display_outputs()) output->end_draw_stuff(); }