derf / feh

a fast and light image viewer
https://feh.finalrewind.org
Other
1.53k stars 159 forks source link

First image opened does not scale down #504

Open desolatorxxl opened 4 years ago

desolatorxxl commented 4 years ago

The first image I open with feh won't be scaled down immediately in bspwm:

Image

(I'm running /bin/feh --auto-zoom --scale-down w7tvLqs.jpg in th GIF)

Resizing the window, hitting w or moving back and forward between images will scale the image correctly though.

This works just fine with imv for example.

Here are the versions I'm running:

$ uname -r
5.4.13-arch1-1
$ bspwm -v
0.9.7-10-g2ffd9c1
$ /bin/feh -version
feh version 3.3
Compile-time switches: curl exif inotify help stat64 verscmp xinerama

Any help or guidance would be appreciated, thanks!

desolatorxxl commented 4 years ago

I digged around a bit and found out that this issue is caused by this commit: https://github.com/derf/feh/pull/462/commits/11eeb961f15219da506a050ffc432e052689dcd6

Reverting the commit and recompiling fixes the issue.

Edit: Pasted wrong commit hash.

FichteFoll commented 4 years ago

I have a similar problem that I bisect'ed to the same commit.

~/code/_tmp/feh [bisect] ∃ git bisect good
11eeb961f15219da506a050ffc432e052689dcd6 is the first bad commit
commit 11eeb961f15219da506a050ffc432e052689dcd6
Author: Elaina Martineau <elainamartineau@gmail.com>
Date:   Thu Mar 14 18:40:20 2019 -0600

    Get geometry after mapping

 src/winwidget.c | 2 ++
 1 file changed, 2 insertions(+)

I've also confirmed that reverting this commit on top of master fixes my issue.

In i3, I set feh to show as floating and I use --scale-down through a theme.

$ cat ~/.config/feh/themes
feh --scale-down

Ever since that commit, an image that needs to be scaled down to fit my screen (usually vertically) is not positioned correctly and instead shows like this:

2020-07-04_20-15-34_feh_scale-down-bug The image shown can be found at https://www.pixiv.net/en/artworks/72848360.

Trying to drag in the image makes the image render correctly perfectly within the window's geometry, as does selecting the next image and going back, because this only occurs when feh is first started. The timestamp also roughly matches since I've had this problem for many months but didn't bother to investigate further.

FichteFoll commented 4 years ago

This is still an issue for me. @CrackedP0t, maybe you could elaborate why this "fix" was needed and how it resulted in bad behavior for apparently only two of us (considering the lack of other reports)?

hachiman-su commented 3 years ago

I have got the exact same issue. I am on i3 as well and opening feh in a a floating window results in the image being incorrectly positioned in the window. Trying to scroll the image will reposition the image correctly. For now I work aroud this with the --reload option.

FichteFoll commented 2 years ago

For the record, reverting the referenced commit still fixes the issue, but the fix is not proper because you can see that the initial position of the rendered image is wrong and after a quick flicker it is positioned (and resized) correctly.

This also happens when navigating to adjacent images without reverting the commit.

desolatorxxl commented 6 months ago

This works fine in dwm. Maybe this is a bspwm issue?

GustawXYZ commented 3 months ago

I'm seeing the same issue on X11 - qtile. Weirdly enough I didn't have it on Arch, but when I reinstalled on NixOS, the issue started appearing.