From edcf09326972611dbc8976139fbfe9cf9ec5e6bd Mon Sep 17 00:00:00 2001 From: nova Date: Sun, 10 May 2026 19:44:17 +0200 Subject: [PATCH] improved main loop sequence for the async rendering --- main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index fa701b1..3c038be 100644 --- a/main.c +++ b/main.c @@ -90,15 +90,10 @@ int main(){ while(!(status & STATUS_QUIT_PROGRAM)){ getmaxyx(stdscr, terminal_height, terminal_width); - if (!(terminal_height == temp_heigth) || !(terminal_width == temp_width)) { - status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_RESIZE); - temp_width = terminal_width; - temp_heigth = terminal_height; - } + user_interactions(); if (status & STATUS_RUN_BACKEND) { free(global_path); global_path = getcwd(NULL, 0); - pthread_cond_signal(&cond_top); pthread_cond_signal(&cond_mid); pthread_cond_signal(&cond_lft); status &= ~(STATUS_RUN_BACKEND); @@ -106,8 +101,12 @@ int main(){ } else { status &= ~(STATUS_RELOAD_DIRECTORY | STATUS_DELTA_TIME); } - user_interactions(); + if (!(terminal_height == temp_heigth) || !(terminal_width == temp_width)) { + status |= (STATUS_RUN_BACKEND | STATUS_UPDATE_SCREEN_RESIZE); + temp_width = terminal_width; + temp_heigth = terminal_height; + } render_pass(); #if SETTINGS_RELOAD_DIR_DELTA != 0