Bug 432075 - Zoom 100% and back to Fit window broken since spin box commit
Summary: Zoom 100% and back to Fit window broken since spin box commit
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (other bugs)
Version First Reported In: Git (add output of "git log -1 --oneline" to description)
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-01-25 08:03 UTC by Leszek Lesner
Modified: 2021-01-27 17:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leszek Lesner 2021-01-25 08:03:57 UTC
SUMMARY
Middle clicking or pressing F key to zoom 100% into an image works not when invoking the first time. Only second time. Zoom to fit window shows the same behavior and only works when invoked a second time. 
Also keys for navigation are not working when zoom to fit window is only invoked once as the image is not fully zoomed out to fit the window. 

STEPS TO REPRODUCE
1. Open Photo that is bigger than window (and have default fit to window set)
2. Press F or middle mouse click to zoom into image
3. Press again to zoom fit into window

OBSERVED RESULT
You need to multiple times press F / middle mouse click for the zoom to work.
Fit to window zoom out does not really zoom out completely which makes left and right arrow keys not work anymore to switch to the next / previous image. 

EXPECTED RESULT
It should work on first invoke of F / middle mouse click

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: git master (5.21.80)
(available in About System)
KDE Plasma Version: 5.21.80 (git master 24.01.2021)
KDE Frameworks Version: 5.79 (git master 24.01.2021)
Qt Version: 5.15.2 

ADDITIONAL INFORMATION
The following commit is causing the issue: 
https://invent.kde.org/graphics/gwenview/-/commit/2cdaca95c1303c69466917398ef6e47b0f3de920
Reverting it fixes the issue.
Comment 1 Nate Graham 2021-01-26 16:12:36 UTC
Antonio, can you investigate? Thanks!
Comment 2 Antonio Prcela 2021-01-26 16:38:05 UTC
(In reply to Nate Graham from comment #1)
> Antonio, can you investigate? Thanks!

Yes, i hope to fix it until friday.
Comment 3 Bug Janitor Service 2021-01-26 19:15:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/gwenview/-/merge_requests/32
Comment 4 Antonio Prcela 2021-01-26 19:16:34 UTC
(In reply to Bug Janitor Service from comment #3)
> A possibly relevant merge request was started @
> https://invent.kde.org/graphics/gwenview/-/merge_requests/32

This should do the trick. I've tested and it works as it used to. Can you also test?
Comment 5 Leszek Lesner 2021-01-26 23:54:00 UTC
This seems to fix it for me aswell. Thank you for the quick fix.
Comment 6 Antonio Prcela 2021-01-27 17:52:22 UTC
Git commit dcf34b852e58d0ba1a32d2d94889d7392e731918 by Antonio Prcela.
Committed on 27/01/2021 at 17:49.
Pushed by ngraham into branch 'master'.

Fix zoom with F or middle mouse click caused by the introduction of the spinbox in 2cdaca95

With the introduction of the spin box, the F button / middle mouse click don't work properly anymore.
Problem caused because the spinbox did an emitZoomChanged even tho the zoom was changed by something else than the spinbox. In the case from the bug report it is 'Fit to window'.
Spin box emits now only after it had focus - either by mouse scroll change or manually typing a value into it.

M  +3    -1    lib/zoomwidget.cpp

https://invent.kde.org/graphics/gwenview/commit/dcf34b852e58d0ba1a32d2d94889d7392e731918