summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-05-03 11:36:16 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-05-03 11:39:16 +0200
commita7e326a5e8f3539815528b1de785980ec3a9b4d0 (patch)
tree156291816810f0e0310023fdcf154a864bee2d32
parentfacde95b2b773f03331a1785082078f3a7f91b64 (diff)
feh_draw_filename: Set correct list number in multiwindow mode (closes #237)
-rw-r--r--src/imlib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/imlib.c b/src/imlib.c
index e6e5b5c..d497311 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -601,8 +601,12 @@ void feh_draw_filename(winwidget w)
len = snprintf(NULL, 0, "%d of %d", gib_list_length(filelist),
gib_list_length(filelist)) + 1;
s = emalloc(len);
- snprintf(s, len, "%d of %d", gib_list_num(filelist, current_file) +
- 1, gib_list_length(filelist));
+ if (w->file)
+ snprintf(s, len, "%d of %d", gib_list_num(filelist, w->file) +
+ 1, gib_list_length(filelist));
+ else
+ snprintf(s, len, "%d of %d", gib_list_num(filelist, current_file) +
+ 1, gib_list_length(filelist));
gib_imlib_get_text_size(fn, s, NULL, &nw, NULL, IMLIB_TEXT_TO_RIGHT);