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 <eylles@noreply.codeberg.org>
This commit is contained in:
NRK 2023-11-13 10:45:49 +00:00
parent 70cbe59daa
commit bed596bf47
1 changed files with 4 additions and 5 deletions

9
main.c
View File

@ -601,12 +601,10 @@ void handle_key_handler(bool init)
if (win.bar.h == 0) if (win.bar.h == 0)
return; return;
if (init) { if (init) {
close_info(); snprintf(win.bar.r.buf, win.bar.r.size,
snprintf(win.bar.l.buf, win.bar.l.size,
"Getting key handler input (%s to abort)...", "Getting key handler input (%s to abort)...",
XKeysymToString(KEYHANDLER_ABORT)); XKeysymToString(KEYHANDLER_ABORT));
} else { /* abort */ } else { /* abort */
open_info();
update_info(); update_info();
} }
win_draw(&win); win_draw(&win);
@ -635,8 +633,7 @@ static bool run_key_handler(const char *key, unsigned int mask)
if (key == NULL) if (key == NULL)
return false; return false;
close_info(); strncpy(win.bar.r.buf, "Running key handler...", win.bar.r.size);
strncpy(win.bar.l.buf, "Running key handler...", win.bar.l.size);
win_draw(&win); win_draw(&win);
win_set_cursor(&win, CURSOR_WATCH); win_set_cursor(&win, CURSOR_WATCH);
setenv("NSXIV_USING_NULL", options->using_null ? "1" : "0", 1); 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) { if (mode == MODE_IMAGE && changed) {
img_close(&img, true); img_close(&img, true);
load_image(fileidx); load_image(fileidx);
} else {
update_info();
} }
free(oldst); free(oldst);
reset_cursor(); reset_cursor();