diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-01-11 20:56:04 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-01-11 20:56:04 +0100 |
commit | 44d33fc2a05415cf20af360ee9f8bffd0d40460d (patch) | |
tree | 1dc32333b98afebd9faa86be1cf23e6f52f28645 | |
parent | 6c604f263291de6b44db6f5703271ddd229b4fa9 (diff) |
rewrite window title whenever the image is rendered (closes #266)
-rw-r--r-- | src/slideshow.c | 2 | ||||
-rw-r--r-- | src/winwidget.c | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/slideshow.c b/src/slideshow.c index 87ab29e..b15c360 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -615,6 +615,8 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid) if (winwid) { snprintf(buf, sizeof(buf), "%.2f", winwid->zoom); strncat(ret, buf, sizeof(ret) - strlen(ret) - 1); + } else { + strncat(ret, "1.00", sizeof(ret) - strlen(ret) - 1); } break; case '%': diff --git a/src/winwidget.c b/src/winwidget.c index 758183b..e92f1c3 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -634,6 +634,12 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias) feh_draw_info(winwid); if (winwid->errstr) feh_draw_errstr(winwid); + if (opt.title) { + /* title might contain e.g. the zoom specifier -> rewrite */ + char *s = slideshow_create_name(FEH_FILE(current_file->data), winwid); + winwidget_rename(winwid, s); + free(s); + } } else if ((opt.mode == MODE_ZOOM) && !antialias) feh_draw_zoom(winwid); |