summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-04-24 12:40:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-04-24 12:40:01 +0200
commit48721aa131f09ffcfe2f35499d3d8fb5a58cb60a (patch)
tree1cd7c1a278ce819489b60ba615400b94150859d4
parent02420aefa5bcdd6cc58c67d736e5ebe34b1f1b4f (diff)
winwidget_render_image: re-zoom image in scaledown/geometry mode after ConfigureNotify event
-rw-r--r--src/winwidget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index 7b178b6..f249694 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -424,8 +424,17 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
feh_draw_checks(winwid);
if (!winwid->full_screen && opt.zoom_mode
- && (winwid->zoom == 1.0) && ! (opt.geom_flags & (WidthValue | HeightValue))
- && (winwid->w > winwid->im_w) && (winwid->h > winwid->im_h))
+ && (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
+ && (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);