summaryrefslogtreecommitdiff
path: root/src/thumbnail.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-05-11 17:03:34 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-05-11 17:03:34 +0200
commit185e861b4975bf2e5505ac7237f6946ee4def608 (patch)
tree95ec2358ea5ee3f9e4d4485111b8ca2ce57541ac /src/thumbnail.c
parent3d71b4746c1cea6e45a65c0c1b2285dfbfcc905b (diff)
Show correct filelist position in windows opened from thumbnail mode
Addresses part of issue #75
Diffstat (limited to 'src/thumbnail.c')
-rw-r--r--src/thumbnail.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/thumbnail.c b/src/thumbnail.c
index 003c7b4..3e99bfb 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -766,17 +766,26 @@ int feh_thumbnail_get_generated(Imlib_Image * image, feh_file * file,
void feh_thumbnail_show_fullsize(feh_file *thumbfile)
{
winwidget thumbwin = NULL;
+ gib_list *l;
+
+ for (l = filelist; l; l = l->next) {
+ if (FEH_FILE(l->data) == thumbfile) {
+ break;
+ }
+ }
+ if (!l) {
+ eprintf("Cannot find %s in filelist, wtf", thumbfile->filename);
+ }
thumbwin = winwidget_get_first_window_of_type(WIN_TYPE_THUMBNAIL_VIEWER);
if (!thumbwin) {
thumbwin = winwidget_create_from_file(
- gib_list_add_front(NULL, thumbfile),
+ l,
WIN_TYPE_THUMBNAIL_VIEWER);
if (thumbwin)
winwidget_show(thumbwin);
} else if (FEH_FILE(thumbwin->file->data) != thumbfile) {
- free(thumbwin->file);
- thumbwin->file = gib_list_add_front(NULL, thumbfile);
+ thumbwin->file = l;
feh_reload_image(thumbwin, 1, 1);
}
}