aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-01-31 00:17:29 +0000
committerHarry Jeffery <harry@exec64.co.uk>2019-01-31 00:19:42 +0000
commitc46924345fc0ef7574e864127c164d72c1fd3011 (patch)
tree4f0e38aa8d8e01d73406ce666ec4fb75f782633b
parent35c81938f39b0767eb63fd8af589d7eb1d24ce8f (diff)
downloadimv-c46924345fc0ef7574e864127c164d72c1fd3011.tar.gz
imv: Close unsupported images more rapidly
-rw-r--r--src/imv.c8
1 files changed, 6 insertions, 2 deletions
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)) {