diff options
Diffstat (limited to 'src/multiwindow.c')
-rw-r--r-- | src/multiwindow.c | 69 |
1 files changed, 24 insertions, 45 deletions
diff --git a/src/multiwindow.c b/src/multiwindow.c index 60d5660..abbf6c9 100644 --- a/src/multiwindow.c +++ b/src/multiwindow.c @@ -28,51 +28,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "timers.h" #include "filelist.h" #include "options.h" +#include "signals.h" -void -init_multiwindow_mode(void) +void init_multiwindow_mode(void) { - winwidget w = NULL; - gib_list *l; - feh_file *file = NULL; - - D_ENTER(2); - - mode = "multiwindow"; - - for (l = filelist; l; l = l->next) - { - char *s = NULL; - int len = 0; - file = FEH_FILE(l->data); - current_file = l; - - if (!opt.title) - { - len = strlen(PACKAGE " - ") + strlen(file->filename) + 1; - s = emalloc(len); - snprintf(s, len, PACKAGE " - %s", file->filename); - } - else - { - s = estrdup(feh_printf(opt.title, file)); - } - - if ((w = winwidget_create_from_file(l, s, WIN_TYPE_SINGLE)) != NULL) - { - winwidget_show(w); - if (opt.reload > 0) - feh_add_unique_timer(cb_reload_timer, w, opt.reload); - if (!feh_main_iteration(0)) - exit(0); - } - else - { - D(3, - ("EEEK. Couldn't load image in multiwindow mode. " - "I 'm not sure if this is a problem\n")); - } - free(s); - } - D_RETURN_(2); + winwidget w = NULL; + gib_list *l; + + if (!opt.title) + opt.title = PACKAGE " - %f"; + + mode = "multiwindow"; + + for (l = filelist; l; l = l->next) { + if ((w = winwidget_create_from_file(l, WIN_TYPE_SINGLE)) != NULL) { + winwidget_show(w); + if (opt.reload > 0) + feh_add_unique_timer(cb_reload_timer, w, opt.reload); + if (!feh_main_iteration(0)) + exit(0); + } else { + D(("EEEK. Couldn't load image in multiwindow mode. " + "I 'm not sure if this is a problem\n")); + } + } + + return; } |