Hello community,
here is the log from the commit of package feh for openSUSE:Factory checked in at 2018-07-21 10:25:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/feh (Old)
and /work/SRC/openSUSE:Factory/.feh.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "feh"
Sat Jul 21 10:25:34 2018 rev:26 rq:624245 version:2.27.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/feh/feh.changes 2018-06-19 11:57:27.499855688 +0200
+++ /work/SRC/openSUSE:Factory/.feh.new/feh.changes 2018-07-21 10:25:36.110951935 +0200
@@ -1,0 +2,19 @@
+Fri Jul 20 10:46:33 UTC 2018 - mimi.vx@gmail.com
+
+- update to 2.27.1
+- fix boo#1101466 - specify PREFIX also for build
+ * Fix --keep-zoom-vp issues introduced in 2.27
+ * Fix feh occasionally becoming unresponsive when asked
+ to terminate via SIGINT/SIGQUIT/SIGTERM
+ * Fix size_to_image ("w") command when both --scale-down and
+ --keep-zoom-vp are enabled
+ * Fix --auto-zoom not being triggered on window resize events
+ when --scale-down is enabled
+ * Fix --auto-zoom conflicting with manual zoom
+ * Prevent --zoom <percent> from blocking --scale-down in fullscreen
+ / fixed geometry mode
+ * Prevent --keep-zoom-vp from blocking the dynamic window resizing mechanism
+ - Prevent automatic recalculation of the zoom ratio when
+ --keep_zoom_vp is enabled
+
+-------------------------------------------------------------------
Old:
----
feh-2.26.3.tar.bz2
feh-2.26.3.tar.bz2.asc
New:
----
feh-2.27.1.tar.bz2
feh-2.27.1.tar.bz2.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ feh.spec ++++++
--- /var/tmp/diff_new_pack.gXy8E9/_old 2018-07-21 10:25:36.854951755 +0200
+++ /var/tmp/diff_new_pack.gXy8E9/_new 2018-07-21 10:25:36.858951753 +0200
@@ -17,7 +17,7 @@
Name: feh
-Version: 2.26.3
+Version: 2.27.1
Release: 0
Summary: X11 image viewer
License: MIT AND LGPL-2.0-or-later
@@ -65,11 +65,13 @@
%build
make %{?_smp_mflags} \
+ PREFIX="%{_prefix}" \
curl=1 \
help=1 \
xinerama=1 \
debug=0 \
exif=1 \
+ app=1 \
OPTFLAGS="%{optflags} -Wall -Wextra"
gcc %{optflags} -fwhole-program jpegexiforient.c -o jpegexiforient
@@ -83,15 +85,8 @@
install -D -m0755 jpegexiforient %{buildroot}%{_bindir}/jpegexiforient
-%post
-%desktop_database_post
-%icon_theme_cache_post
-
-%postun
-%desktop_database_postun
-%icon_theme_cache_postun
-
%files
+%license COPYING
%doc AUTHORS ChangeLog README.md TODO
%{_bindir}/feh
%{_bindir}/feh-cam
++++++ feh-2.26.3.tar.bz2 -> feh-2.27.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/ChangeLog new/feh-2.27.1/ChangeLog
--- old/feh-2.26.3/ChangeLog 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/ChangeLog 2018-07-17 17:41:02.000000000 +0200
@@ -1,3 +1,34 @@
+Tue, 17 Jul 2018 17:33:10 +0200 Daniel Friesel
+
+* Release v2.27.1
+ * Fix feh occasionally becoming unresponsive when asked to terminate
+ via SIGINT/SIGQUIT/SIGTERM (based on a patch by
+ https://github.com/giladogit)
+ * Fix --keep-zoom-vp issues introduced in 2.27
+ (patch by https://github.com/ulteq)
+
+Thu, 28 Jun 2018 17:26:54 +0200 Daniel Friesel
+
+* Release v2.27
+ * Fix size_to_image ("w") command when both --scale-down and --keep-zoom-vp
+ are enabled
+ * Fix --auto-zoom not being triggered on window resize events when
+ --scale-down is enabled
+ * Fix --auto-zoom conflicting with manual zoom
+ * Fix feh_draw_checks not taking the zoom level into account properly
+ * Prevent --zoom <percent> from blocking --scale-down in fullscreen / fixed
+ geometry mode
+ * Prevent --keep-zoom-vp from blocking the dynamic window resizing
+ mechanism
+ * Prevent automatic recalculation of the zoom ratio when --keep_zoom_vp
+ is enabled
+ * All patches provided by https://github.com/ulteq. Thanks a lot!
+
+Tue, 26 Jun 2018 10:33:04 +0200 Daniel Friesel
+
+* Release v2.26.4
+ * Correctly save --bg-max in ~/.fehbg (patch by Sebastian Bickerle)
+
Fri, 18 May 2018 22:58:02 +0200 Daniel Friesel
* Release v2.26.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/config.mk new/feh-2.27.1/config.mk
--- old/feh-2.26.3/config.mk 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/config.mk 2018-07-17 17:41:02.000000000 +0200
@@ -1,5 +1,5 @@
PACKAGE ?= feh
-VERSION ?= 2.26.3
+VERSION ?= 2.27.1
app ?= 0
cam ?= 0
@@ -87,7 +87,7 @@
MAN_EXIF = disabled
endif
-MAN_DATE ?= May 18, 2018
+MAN_DATE ?= July 17, 2018
# Uncomment this to use dmalloc
#CFLAGS += -DWITH_DMALLOC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/main.c new/feh-2.27.1/src/main.c
--- old/feh-2.26.3/src/main.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/main.c 2018-07-17 17:41:02.000000000 +0200
@@ -87,7 +87,7 @@
/* main event loop */
while (feh_main_iteration(1));
- return(0);
+ return(sig_exit);
}
/* Return 0 to stop iterating, 1 if ok to continue. */
@@ -104,7 +104,7 @@
double t1 = 0.0, t2 = 0.0;
fehtimer ft;
- if (window_num == 0)
+ if (window_num == 0 || sig_exit != 0)
return(0);
if (first) {
@@ -137,7 +137,7 @@
if (ev_handler[ev.type])
(*(ev_handler[ev.type])) (&ev);
- if (window_num == 0)
+ if (window_num == 0 || sig_exit != 0)
return(0);
}
XFlush(disp);
@@ -191,7 +191,7 @@
in that */
feh_handle_timer();
}
- else if (count && (FD_ISSET(0, &fdset)))
+ else if ((count > 0) && (FD_ISSET(0, &fdset)))
feh_event_handle_stdin();
}
} else {
@@ -204,11 +204,11 @@
&& ((errno == ENOMEM) || (errno == EINVAL)
|| (errno == EBADF)))
eprintf("Connection to X display lost");
- else if (count && (FD_ISSET(0, &fdset)))
+ else if ((count > 0) && (FD_ISSET(0, &fdset)))
feh_event_handle_stdin();
}
}
- if (window_num == 0)
+ if (window_num == 0 || sig_exit != 0)
return(0);
return(1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/options.c new/feh-2.27.1/src/options.c
--- old/feh-2.26.3/src/options.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/options.c 2018-07-17 17:41:02.000000000 +0200
@@ -592,6 +592,7 @@
opt.filelistfile = estrdup(optarg);
break;
case 'g':
+ opt.geom_enabled = 1;
opt.geom_flags = XParseGeometry(optarg, &opt.geom_x,
&opt.geom_y, &opt.geom_w, &opt.geom_h);
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/options.h new/feh-2.27.1/src/options.h
--- old/feh-2.26.3/src/options.h 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/options.h 2018-07-17 17:41:02.000000000 +0200
@@ -106,6 +106,7 @@
int sort;
int version_sort;
int debug;
+ int geom_enabled;
int geom_flags;
int geom_x;
int geom_y;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/signals.c new/feh-2.27.1/src/signals.c
--- old/feh-2.26.3/src/signals.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/signals.c 2018-07-17 17:41:02.000000000 +0200
@@ -28,6 +28,7 @@
#include "options.h"
void feh_handle_signal(int);
+int sig_exit = 0;
void setup_signal_handlers()
{
@@ -86,7 +87,8 @@
case SIGQUIT:
if (childpid)
killpg(childpid, SIGINT);
- exit(128 + signo);
+ sig_exit = 128 + signo;
+ return;
}
winwid = winwidget_get_first_window_of_type(WIN_TYPE_SLIDESHOW);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/signals.h new/feh-2.27.1/src/signals.h
--- old/feh-2.26.3/src/signals.h 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/signals.h 2018-07-17 17:41:02.000000000 +0200
@@ -27,5 +27,5 @@
#define SIGNALS_H
void setup_signal_handlers();
-
+extern int sig_exit;
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/slideshow.c new/feh-2.27.1/src/slideshow.c
--- old/feh-2.26.3/src/slideshow.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/slideshow.c 2018-07-17 17:41:02.000000000 +0200
@@ -143,16 +143,6 @@
Imlib_Image tmp;
int old_w, old_h;
- unsigned char tmode =0;
- int tim_x =0;
- int tim_y =0;
- double tzoom =0;
-
- tmode = w->mode;
- tim_x = w->im_x;
- tim_y = w->im_y;
- tzoom = w->zoom;
-
if (!w->file) {
im_weprintf(w, "couldn't reload, this image has no file associated with it.");
winwidget_render_image(w, 0, 0);
@@ -217,16 +207,7 @@
w->im_w = gib_imlib_image_get_width(w->im);
w->im_h = gib_imlib_image_get_height(w->im);
}
- if (opt.keep_zoom_vp) {
- /* put back in: */
- w->mode = tmode;
- w->im_x = tim_x;
- w->im_y = tim_y;
- w->zoom = tzoom;
- winwidget_render_image(w, 0, 0);
- } else {
- winwidget_render_image(w, resize, 0);
- }
+ winwidget_render_image(w, resize, 0);
return;
}
@@ -241,11 +222,6 @@
*/
int our_filelist_len = filelist_len;
- unsigned char tmode =0;
- int tim_x =0;
- int tim_y =0;
- double tzoom =0;
-
/* Without this, clicking a one-image slideshow reloads it. Not very *
intelligent behaviour :-) */
if (filelist_len < 2 && opt.cycle_once == 0)
@@ -356,14 +332,6 @@
last = NULL;
}
- if (opt.keep_zoom_vp) {
- /* pre loadimage - record settings */
- tmode = winwid->mode;
- tim_x = winwid->im_x;
- tim_y = winwid->im_y;
- tzoom = winwid->zoom;
- }
-
if (winwidget_loadimage(winwid, FEH_FILE(current_file->data))) {
int w = gib_imlib_image_get_width(winwid->im);
int h = gib_imlib_image_get_height(winwid->im);
@@ -378,19 +346,8 @@
winwidget_reset_image(winwid);
winwid->im_w = w;
winwid->im_h = h;
- if (opt.keep_zoom_vp) {
- /* put back in: */
- winwid->mode = tmode;
- winwid->im_x = tim_x;
- winwid->im_y = tim_y;
- winwid->zoom = tzoom;
- }
if (render) {
- if (opt.keep_zoom_vp) {
- winwidget_render_image(winwid, 0, 0);
- } else {
- winwidget_render_image(winwid, 1, 0);
- }
+ winwidget_render_image(winwid, 1, 0);
}
break;
} else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/wallpaper.c new/feh-2.27.1/src/wallpaper.c
--- old/feh-2.26.3/src/wallpaper.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/wallpaper.c 2018-07-17 17:41:02.000000000 +0200
@@ -467,8 +467,10 @@
fputs("center", fp);
else if (scaled)
fputs("scale", fp);
- else if (filled)
+ else if (filled == 1)
fputs("fill", fp);
+ else if (filled == 2)
+ fputs("max", fp);
else
fputs("tile", fp);
if (opt.image_bg) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/winwidget.c new/feh-2.27.1/src/winwidget.c
--- old/feh-2.26.3/src/winwidget.c 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/winwidget.c 2018-07-17 17:41:02.000000000 +0200
@@ -323,11 +323,12 @@
winwidget_register(ret);
/* do not scale down a thumbnail list window, only those created from it */
- if (opt.scale_down && (ret->type != WIN_TYPE_THUMBNAIL)) {
+ if (opt.geom_enabled && (ret->type != WIN_TYPE_THUMBNAIL)) {
opt.geom_w = w;
opt.geom_h = h;
opt.geom_flags |= WidthValue | HeightValue;
}
+
return;
}
@@ -422,165 +423,66 @@
int sx, sy, sw, sh, dx, dy, dw, dh;
int calc_w, calc_h;
int antialias = 0;
- int need_center = winwid->had_resize;
if (!winwid->full_screen && resize) {
winwidget_resize(winwid, winwid->im_w, winwid->im_h, 0);
winwidget_reset_image(winwid);
}
- /* bounds checks for panning */
- if (winwid->im_x > winwid->w)
- winwid->im_x = winwid->w;
- if (winwid->im_y > winwid->h)
- winwid->im_y = winwid->h;
-
D(("winwidget_render_image resize %d force_alias %d im %dx%d\n",
resize, force_alias, winwid->im_w, winwid->im_h));
- winwidget_setup_pixmaps(winwid);
+ /* winwidget_setup_pixmaps(winwid) resets the winwid->had_resize flag */
+ int had_resize = winwid->had_resize || resize;
- if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im))
- || (opt.geom_flags & (WidthValue | HeightValue))
- || (winwid->im_x || winwid->im_y) || (winwid->zoom != 1.0)
- || (winwid->w > winwid->im_w || winwid->h > winwid->im_h)
- || (winwid->has_rotated)))
- feh_draw_checks(winwid);
-
- if (!winwid->full_screen && opt.zoom_mode && (winwid->type != WIN_TYPE_THUMBNAIL)
- && (winwid->zoom == 1.0) && ! (opt.geom_flags & (WidthValue | HeightValue))
- && (winwid->w > winwid->im_w) && (winwid->h > winwid->im_h))
- feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h);
-
- /*
- * In case of a resize, the geomflags (and im_w, im_h) get updated by
- * the ConfigureNotify handler.
- */
- if (need_center && !winwid->full_screen && (winwid->type != WIN_TYPE_THUMBNAIL)
- && (opt.geom_flags & (WidthValue | HeightValue))
- && ((winwid->w < winwid->im_w) || (winwid->h < winwid->im_h)))
- feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h);
-
-
- if (resize && (winwid->type != WIN_TYPE_THUMBNAIL) &&
- (winwid->full_screen || (opt.geom_flags & (WidthValue | HeightValue)))) {
- int smaller; /* Is the image smaller than screen? */
- int max_w = 0, max_h = 0;
-
- if (winwid->full_screen) {
- max_w = scr->width;
- max_h = scr->height;
-#ifdef HAVE_LIBXINERAMA
- if (opt.xinerama && xinerama_screens) {
- max_w = xinerama_screens[xinerama_screen].width;
- max_h = xinerama_screens[xinerama_screen].height;
- }
-#endif /* HAVE_LIBXINERAMA */
- } else {
- if (opt.geom_flags & WidthValue) {
- max_w = opt.geom_w;
- }
- if (opt.geom_flags & HeightValue) {
- max_h = opt.geom_h;
- }
- }
-
- D(("Calculating for fullscreen/fixed geom render\n"));
- smaller = ((winwid->im_w < max_w)
- && (winwid->im_h < max_h));
-
- if (!smaller || opt.zoom_mode) {
- /* contributed by Jens Laas
- * What it does:
- * zooms images by a fixed amount but never larger than the screen.
- *
- * Why:
- * This is nice if you got a collection of images where some
- * are small and can stand a small zoom. Large images are unaffected.
- *
- * When does it work, and how?
- * You have to be in fullscreen mode _and_ have auto-zoom turned on.
- * "feh -FZ --zoom 130 imagefile" will do the trick.
- * -zoom percent - the new switch.
- * 100 = orignal size,
- * 130 is 30% larger.
- */
- if (opt.default_zoom) {
- double old_zoom = winwid->zoom;
-
- winwid->zoom = 0.01 * opt.default_zoom;
- if (opt.default_zoom != 100) {
- if ((winwid->im_h * winwid->zoom) > max_h)
- winwid->zoom = old_zoom;
- else if ((winwid->im_w * winwid->zoom) > max_w)
- winwid->zoom = old_zoom;
- }
+ winwidget_setup_pixmaps(winwid);
- winwid->im_x = ((int)
- (max_w - (winwid->im_w * winwid->zoom))) >> 1;
- winwid->im_y = ((int)
- (max_h - (winwid->im_h * winwid->zoom))) >> 1;
- } else {
- /* Image is larger than the screen (so wants shrinking), or it's
- smaller but wants expanding to fill it */
- double ratio = feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, max_w, max_h);
-
- if (ratio > 1.0) {
- /* height is the factor */
- winwid->im_x = 0;
- winwid->im_y = ((int)
- (max_h - (winwid->im_h * winwid->zoom))) >> 1;
- } else {
- /* width is the factor */
- winwid->im_x = ((int)
- (max_w - (winwid->im_w * winwid->zoom))) >> 1;
- winwid->im_y = 0;
- }
- }
- } else {
- /* my modification to jens hack, allow --zoom without auto-zoom mode */
- if (opt.default_zoom) {
- winwid->zoom = 0.01 * opt.default_zoom;
- } else {
- winwid->zoom = 1.0;
- }
- /* Just center the image in the window */
- winwid->im_x = (int) (max_w - (winwid->im_w * winwid->zoom)) >> 1;
- winwid->im_y = (int) (max_h - (winwid->im_h * winwid->zoom)) >> 1;
- }
- }
- else if (need_center && !winwid->full_screen
- && (winwid->type != WIN_TYPE_THUMBNAIL) && !opt.keep_zoom_vp) {
- winwid->im_x = (int) (winwid->w - (winwid->im_w * winwid->zoom)) >> 1;
- winwid->im_y = (int) (winwid->h - (winwid->im_h * winwid->zoom)) >> 1;
- }
-
- /*
- * Adjust X/Y offset if the image is larger than the window and
- * --inner-geometry is set. This will cause odd behaviour when
- * zooming an already large image in --inner-geometry mode, but in most
- * cases this should be what the user wants. Plus, it doesn't require
- * fiddling around in two or three places above, so it's the best
- * solution considering a future refactoring of this function.
- */
+ if (had_resize && !opt.keep_zoom_vp && (winwid->type != WIN_TYPE_THUMBNAIL)) {
+ double required_zoom = 1.0;
+ feh_calc_needed_zoom(&required_zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h);
+
+ winwid->zoom = opt.default_zoom ? (0.01 * opt.default_zoom) : 1.0;
+
+ if ((opt.scale_down || (winwid->full_screen && !opt.default_zoom))
+ && winwid->zoom > required_zoom)
+ winwid->zoom = required_zoom;
+ else if ((opt.zoom_mode && required_zoom > 1)
+ && (!opt.default_zoom || required_zoom < winwid->zoom))
+ winwid->zoom = required_zoom;
- if (need_center || resize) {
- if ((opt.offset_flags & XValue) && (winwid->im_w * winwid->zoom) > winwid->w) {
+ if (opt.offset_flags & XValue) {
if (opt.offset_flags & XNegative) {
winwid->im_x = winwid->w - (winwid->im_w * winwid->zoom) - opt.offset_x;
} else {
winwid->im_x = - opt.offset_x * winwid->zoom;
}
+ } else {
+ winwid->im_x = (int) (winwid->w - (winwid->im_w * winwid->zoom)) >> 1;
}
- if ((opt.offset_flags & YValue) && (winwid->im_h * winwid->zoom) > winwid->h) {
+ if (opt.offset_flags & YValue) {
if (opt.offset_flags & YNegative) {
winwid->im_y = winwid->h - (winwid->im_h * winwid->zoom) - opt.offset_y;
} else {
winwid->im_y = - opt.offset_y * winwid->zoom;
}
+ } else {
+ winwid->im_y = (int) (winwid->h - (winwid->im_h * winwid->zoom)) >> 1;
}
}
+ winwid->had_resize = 0;
+
+ if (opt.keep_zoom_vp)
+ winwidget_sanitise_offsets(winwid);
+
+ if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im))
+ || (opt.geom_flags & (WidthValue | HeightValue))
+ || (winwid->im_x || winwid->im_y)
+ || (winwid->w > winwid->im_w * winwid->zoom)
+ || (winwid->h > winwid->im_h * winwid->zoom)
+ || (winwid->has_rotated)))
+ feh_draw_checks(winwid);
+
/* Now we ensure only to render the area we're looking at */
dx = winwid->im_x;
dy = winwid->im_y;
@@ -732,13 +634,6 @@
return(checks_pmap);
}
-void winwidget_clear_background(winwidget w)
-{
- XSetWindowBackgroundPixmap(disp, w->win, feh_create_checks());
- /* XClearWindow(disp, w->win); */
- return;
-}
-
void feh_draw_checks(winwidget win)
{
static GC gc = None;
@@ -898,24 +793,30 @@
D((" x %d y %d w %d h %d\n", attributes.x, attributes.y, winwid->w,
winwid->h));
- if ((opt.geom_flags & (WidthValue | HeightValue)) && !force_resize) {
- winwid->had_resize = 1;
- return;
- }
+ if ((opt.geom_flags & (WidthValue | HeightValue)) && !force_resize) {
+ winwid->had_resize = 1;
+ return;
+ }
if (winwid && ((winwid->w != w) || (winwid->h != h))) {
- /* winwidget_clear_background(winwid); */
if (opt.screen_clip) {
- winwid->w = (w > scr_width) ? scr_width : w;
- winwid->h = (h > scr_height) ? scr_height : h;
+ double required_zoom = winwid->zoom;
+ if (opt.scale_down && !opt.keep_zoom_vp) {
+ int max_w = (w > scr_width) ? scr_width : w;
+ int max_h = (h > scr_height) ? scr_height : h;
+ feh_calc_needed_zoom(&required_zoom, winwid->im_w, winwid->im_h, max_w, max_h);
+ }
+ int desired_w = winwid->im_w * required_zoom;
+ int desired_h = winwid->im_h * required_zoom;
+ winwid->w = (desired_w > scr_width) ? scr_width : desired_w;
+ winwid->h = (desired_h > scr_height) ? scr_height : desired_h;
}
if (winwid->full_screen) {
- XTranslateCoordinates(disp, winwid->win, attributes.root,
- -attributes.border_width -
- attributes.x,
- -attributes.border_width - attributes.y, &tc_x, &tc_y, &dw);
- winwid->x = tc_x;
- winwid->y = tc_y;
- XMoveResizeWindow(disp, winwid->win, tc_x, tc_y, winwid->w, winwid->h);
+ XTranslateCoordinates(disp, winwid->win, attributes.root,
+ -attributes.border_width - attributes.x,
+ -attributes.border_width - attributes.y, &tc_x, &tc_y, &dw);
+ winwid->x = tc_x;
+ winwid->y = tc_y;
+ XMoveResizeWindow(disp, winwid->win, tc_x, tc_y, winwid->w, winwid->h);
} else
XResizeWindow(disp, winwid->win, winwid->w, winwid->h);
@@ -1043,10 +944,12 @@
void winwidget_reset_image(winwidget winwid)
{
- winwid->zoom = 1.0;
- winwid->old_zoom = 1.0;
- winwid->im_x = 0;
- winwid->im_y = 0;
+ if (!opt.keep_zoom_vp) {
+ winwid->zoom = 1.0;
+ winwid->old_zoom = 1.0;
+ winwid->im_x = 0;
+ winwid->im_y = 0;
+ }
winwid->im_angle = 0.0;
winwid->has_rotated = 0;
return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/feh-2.26.3/src/winwidget.h new/feh-2.27.1/src/winwidget.h
--- old/feh-2.26.3/src/winwidget.h 2018-05-18 23:00:55.000000000 +0200
+++ new/feh-2.27.1/src/winwidget.h 2018-07-17 17:41:02.000000000 +0200
@@ -146,7 +146,6 @@
void winwidget_rename(winwidget winwid, char *newname);
void winwidget_destroy(winwidget winwid);
void winwidget_create_window(winwidget ret, int w, int h);
-void winwidget_clear_background(winwidget w);
Pixmap feh_create_checks(void);
double feh_calc_needed_zoom(double *zoom, int orig_w, int orig_h, int dest_w, int dest_h);
void feh_debug_print_winwid(winwidget winwid);