Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/imlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ void feh_reload_image(winwidget w, int resize, int force_new)
* the new image cannot be loaded, so we must not free the old image yet.
*/
if (force_new)
winwidget_free_image(w);
winwidget_free_image_and_decache(w);

// if it's an external image, our own cache will also get in your way
char *sfn;
Expand Down
2 changes: 1 addition & 1 deletion src/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void feh_handle_signal(int signo)
else if (signo == SIGUSR2)
slideshow_change_image(winwid, SLIDE_PREV, 1);
} else {
feh_reload_image(winwid, 0, 0);
feh_reload_image(winwid, 0, 1);
}
} else if (opt.multiwindow) {
for (i = window_num - 1; i >= 0; i--)
Expand Down
11 changes: 10 additions & 1 deletion src/winwidget.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ void feh_event_handle_inotify(void)
} else if (event->mask & (IN_CLOSE_WRITE | IN_MOVED_TO)) {
if (strcmp(event->name, FEH_FILE(windows[j]->file->data)->name) == 0) {
D(("inotify says file changed\n"));
feh_reload_image(windows[j], 0, 0);
feh_reload_image(windows[j], 0, 1);
}
}
break;
Expand Down Expand Up @@ -1059,6 +1059,15 @@ void winwidget_free_image(winwidget w)
return;
}

void winwidget_free_image_and_decache(winwidget w)
{
if (w->im) {
gib_imlib_free_image_and_decache(w->im);
}
w->im = NULL;
winwidget_free_image(w);
}

void feh_debug_print_winwid(winwidget w)
{
printf("winwid_debug:\n" "winwid = %p\n" "win = %ld\n" "w = %d\n"
Expand Down
1 change: 1 addition & 0 deletions src/winwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void winwidget_show_menu(winwidget winwid);
void winwidget_hide(winwidget winwid);
void winwidget_destroy_all(void);
void winwidget_free_image(winwidget w);
void winwidget_free_image_and_decache(winwidget w);
void winwidget_center_image(winwidget w);
void winwidget_render_image(winwidget winwid, int resize, int force_alias);
void winwidget_rotate_image(winwidget winid, double angle);
Expand Down