summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/thumbnail.c15
-rw-r--r--src/winwidget.c2
2 files changed, 12 insertions, 5 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);
}
}
diff --git a/src/winwidget.c b/src/winwidget.c
index beae9fa..7aae191 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -773,8 +773,6 @@ void winwidget_destroy(winwidget winwid)
free(winwid->name);
if (winwid->gc)
XFreeGC(disp, winwid->gc);
- if ((winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) && (winwid->file != NULL))
- gib_list_free(winwid->file);
if (winwid->im)
gib_imlib_free_image_and_decache(winwid->im);
free(winwid);