Unverified Commit 2ac79eae authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

winwidget_resize: Do not call winwidget_get_geometry after XFlush

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.

Partially reverts 6af56d54

See also https://github.com/derf/feh/pull/462

Thanks to Awal Garg for several joint debugging sessions.
parent 0ce15f6b
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -962,7 +962,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)) {