From bed596bf47a1571639aa1427dbdd57f00ed0503e Mon Sep 17 00:00:00 2001 From: NRK Date: Mon, 13 Nov 2023 10:45:49 +0000 Subject: [PATCH] move key-handler prompts to the right bar (#481) this makes it more consistent with e4fceab by moving the key-handler related messages to the right side as well. additionally this fixes a regression introduced by 3659361 where the left statusbar would remain at "Running key-handler..." if the image didn't change. Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/481 Reviewed-by: eylles --- main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index e0ff5b3..0e1e15c 100644 --- a/main.c +++ b/main.c @@ -601,12 +601,10 @@ void handle_key_handler(bool init) if (win.bar.h == 0) return; if (init) { - close_info(); - snprintf(win.bar.l.buf, win.bar.l.size, + snprintf(win.bar.r.buf, win.bar.r.size, "Getting key handler input (%s to abort)...", XKeysymToString(KEYHANDLER_ABORT)); } else { /* abort */ - open_info(); update_info(); } win_draw(&win); @@ -635,8 +633,7 @@ static bool run_key_handler(const char *key, unsigned int mask) if (key == NULL) return false; - close_info(); - strncpy(win.bar.l.buf, "Running key handler...", win.bar.l.size); + strncpy(win.bar.r.buf, "Running key handler...", win.bar.r.size); win_draw(&win); win_set_cursor(&win, CURSOR_WATCH); setenv("NSXIV_USING_NULL", options->using_null ? "1" : "0", 1); @@ -687,6 +684,8 @@ static bool run_key_handler(const char *key, unsigned int mask) if (mode == MODE_IMAGE && changed) { img_close(&img, true); load_image(fileidx); + } else { + update_info(); } free(oldst); reset_cursor();