Skip to content

Commit

Permalink
Fix render order in draw_stuff (#1801)
Browse files Browse the repository at this point in the history
Pre draw hook is expected to run before anything else, so I moved imlib (e.g. ${image}) rendering after it.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
  • Loading branch information
Caellian authored Apr 8, 2024
1 parent 407769d commit 0419e01
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/conky.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 0419e01

Please sign in to comment.