improved main loop sequence for the async rendering
This commit is contained in:
13
main.c
13
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
|
||||
|
||||
Reference in New Issue
Block a user