From c46924345fc0ef7574e864127c164d72c1fd3011 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 31 Jan 2019 00:17:29 +0000 Subject: imv: Close unsupported images more rapidly --- src/imv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/imv.c') diff --git a/src/imv.c b/src/imv.c index 4d084d8..eaed73f 100644 --- a/src/imv.c +++ b/src/imv.c @@ -700,8 +700,12 @@ int imv_run(struct imv *imv) continue; } - /* if the user has changed image, start loading the new one */ - if(imv_navigator_poll_changed(imv->navigator)) { + /* If the user has changed image, start loading the new one. It's possible + * that there are lots of unsupported files listed back to back, so we + * may immediate close one and navigate onto the next. So we attempt to + * load in a while loop until the navigation stops. + */ + while (imv_navigator_poll_changed(imv->navigator)) { const char *current_path = imv_navigator_selection(imv->navigator); /* check we got a path back */ if(strcmp("", current_path)) { -- cgit v1.2.3