summaryrefslogtreecommitdiff
path: root/src/winwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/winwidget.c')
-rw-r--r--src/winwidget.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 37031ec..b98cbef 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -1,7 +1,7 @@
/* winwidget.c
Copyright (C) 1999-2003 Tom Gilbert.
-Copyright (C) 2010-2020 Daniel Friesel.
+Copyright (C) 2010-2020 Birte Kristina Friesel.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -104,8 +104,13 @@ winwidget winwidget_create_from_image(Imlib_Image im, char type)
ret->w = ret->im_w = gib_imlib_image_get_width(ret->im);
ret->h = ret->im_h = gib_imlib_image_get_height(ret->im);
- if (opt.full_screen && (type != WIN_TYPE_THUMBNAIL))
+ if (opt.full_screen && (type != WIN_TYPE_THUMBNAIL)) {
ret->full_screen = True;
+ } else if (opt.default_zoom) {
+ ret->zoom = 0.01 * opt.default_zoom;
+ ret->w *= ret->zoom;
+ ret->h *= ret->zoom;
+ }
winwidget_create_window(ret, ret->w, ret->h);
winwidget_render_image(ret, 1, 0);
@@ -133,8 +138,13 @@ winwidget winwidget_create_from_file(gib_list * list, char type)
ret->w = ret->im_w = gib_imlib_image_get_width(ret->im);
ret->h = ret->im_h = gib_imlib_image_get_height(ret->im);
D(("image is %dx%d pixels, format %s\n", ret->w, ret->h, gib_imlib_image_format(ret->im)));
- if (opt.full_screen)
+ if (opt.full_screen) {
ret->full_screen = True;
+ } else if (opt.default_zoom) {
+ ret->zoom = 0.01 * opt.default_zoom;
+ ret->w *= ret->zoom;
+ ret->h *= ret->zoom;
+ }
winwidget_create_window(ret, ret->w, ret->h);
winwidget_render_image(ret, 1, 0);
}
@@ -454,7 +464,12 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
int antialias = 0;
if (!winwid->full_screen && resize) {
- winwidget_resize(winwid, winwid->im_w, winwid->im_h, 0);
+ if (opt.default_zoom) {
+ winwid->zoom = 0.01 * opt.default_zoom;
+ winwidget_resize(winwid, winwid->im_w * winwid->zoom, winwid->im_h * winwid->zoom, 0);
+ } else {
+ winwidget_resize(winwid, winwid->im_w, winwid->im_h, 0);
+ }
winwidget_reset_image(winwid);
}
@@ -724,7 +739,7 @@ void winwidget_inotify_remove(winwidget winwid)
#ifdef HAVE_INOTIFY
void winwidget_inotify_add(winwidget winwid, feh_file * file)
{
- if (opt.auto_reload) {
+ if (opt.auto_reload && !path_is_url(file->filename)) {
D(("Adding inotify watch for %s\n", file->filename));
char dir[PATH_MAX];
feh_file_dirname(dir, file, PATH_MAX);
@@ -763,7 +778,7 @@ void feh_event_handle_inotify(void)
for (int j = 0; j < window_num; j++) {
if(windows[j]->inotify_wd == event->wd) {
if (event->mask & IN_IGNORED) {
- D(("inotify watch was implicitely removed\n"));
+ D(("inotify watch was implicitly removed\n"));
windows[j]->inotify_wd = -1;
} else if (event->mask & (IN_CLOSE_WRITE | IN_MOVED_TO)) {
if (strcmp(event->name, FEH_FILE(windows[j]->file->data)->name) == 0) {