summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog15
-rw-r--r--src/winwidget.c25
2 files changed, 31 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index d984cdf..efcfd4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Tue, 09 Sep 2025 21:49:48 +0200 Birte Friesel <derf+feh@finalrewind.org>
+
+* Release v3.11.2
+ * Fix zoom_fit not centering the image correctly if the window is larger
+ than the image
+ * Fix rendering bugs introduced by attempts to fix a --scale-down
+ rendering issue in v3.11 and v3.11.1
+ * Note that this fix comes at the cost of slightly more visible
+ flashing in some cases where feh has to (re-)render an image multiple
+ times, especially if a fixed size is forced by the window manager.
+ While this behaviour can be annoying, it is certainly less annoying than
+ incorrect image offets.
+ * Thanks to Awal Garg for several joint debugging sessions related to
+ --scale-down rendering issues.
+
Fri, 29 Aug 2025 19:14:26 +0200 Birte Friesel <derf+feh@finalrewind.org>
* Release v3.11.1
diff --git a/src/winwidget.c b/src/winwidget.c
index cd117ac..809a0a6 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -500,10 +500,8 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
} else {
winwid->im_x = - opt.offset_x * winwid->zoom;
}
- } else if (!opt.scale_down || (winwid->w != winwid->im_w)) {
- winwid->im_x = (int) (winwid->w - (winwid->im_w * winwid->zoom)) >> 1;
} else {
- winwid->im_x = 0;
+ winwid->im_x = (int) (winwid->w - (winwid->im_w * winwid->zoom)) >> 1;
}
if (opt.offset_flags & YValue) {
if (opt.offset_flags & YNegative) {
@@ -511,10 +509,8 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
} else {
winwid->im_y = - opt.offset_y * winwid->zoom;
}
- } else if (!opt.scale_down || (winwid->h != winwid->im_h)) {
- winwid->im_y = (int) (winwid->h - (winwid->im_h * winwid->zoom)) >> 1;
} else {
- winwid->im_y = 0;
+ winwid->im_y = (int) (winwid->h - (winwid->im_h * winwid->zoom)) >> 1;
}
}
@@ -962,7 +958,18 @@ void winwidget_resize(winwidget winwid, int w, int h, int force_resize)
winwid->had_resize = 1;
XFlush(disp);
- winwidget_get_geometry(winwid, NULL);
+ /*
+ * Note:
+ * While calling winwidget_get_geometry(winwid, NULL); at this point
+ * would help alleviate flashing issues that can occur when feh has
+ * to render a window two times in a row, or renders the initial image
+ * with a resolution that differs from the one that is needed to
+ * accomodate the resize.
+ *
+ * However, it would also break --scale-down in floating setups. As
+ * flashing is less annoying, we do not call winwidget_get_geometry.
+ * here.
+ */
if (force_resize && (opt.geom_flags & (WidthValue | HeightValue))
&& (winwid->type != WIN_TYPE_THUMBNAIL)) {
@@ -1118,11 +1125,11 @@ void winwidget_center_image(winwidget winwid)
if (opt.geom_flags & WidthValue)
winwid->im_x = ((int)opt.geom_w - lround(winwid->im_w * winwid->zoom)) >> 1;
else
- winwid->im_x = 0;
+ winwid->im_x = (int) (winwid->w - lround(winwid->im_w * winwid->zoom)) >> 1;
if (opt.geom_flags & HeightValue)
winwid->im_y = ((int)opt.geom_h - lround(winwid->im_h * winwid->zoom)) >> 1;
else
- winwid->im_y = 0;
+ winwid->im_y = (int) (winwid->h - lround(winwid->im_h * winwid->zoom)) >> 1;
}
}