Bug 479550

Summary: Mouse back/forward buttons do 2 steps instead of 1, while main toolbar icons work as expected
Product: [Applications] Falkon Reporter: Andreas Sturmlechner <asturm>
Component: generalAssignee: David Rosca <nowrep>
Status: RESOLVED FIXED    
Severity: normal CC: dougshaw77, jurajoravec
Priority: NOR Keywords: qt6, regression
Version First Reported In: 24.01.85   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andreas Sturmlechner 2024-01-08 21:19:49 UTC
SUMMARY
***
This is also visible in the URL bar where the first step is immediately followed by the second one.
***

This is a regression over falkon with QtWebengine-5.


STEPS TO REPRODUCE
1.  Visit a website
2.  Click through several links
3.  Try to navigate back and forth using mouse buttons as opposed to toolbar icons


SOFTWARE/OS VERSIONS
Operating System: Gentoo 2.14
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Kernel Version: 6.6.10-gentoo (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 62,7 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Product Name: X570 Phantom Gaming-ITX/TB3
Comment 1 Doug 2024-01-09 04:40:34 UTC
I can reproduce this:

Operating System: KDE Neon Unstable
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1
Comment 2 Juraj 2024-01-09 08:26:41 UTC
Hello,

Can confirm.

Behaviour:
- Press the mouse Back / Forward button
- Falkon code reacts to mousePressEvent and goes back / forward in history
- Release the button
- QtWebEngine internal code is triggered and goes back / forward in history

Solution:
Override the mouse release event and accept the back and forward buttons.

Result:
Seems to work


I will push this workaround later.
Thank you for reporting.
Comment 3 Juraj 2024-01-09 23:56:12 UTC
Git commit 08f7a45021e0cf2c8e571cb89736d071eb0589ef by Juraj Oravec.
Committed on 10/01/2024 at 00:54.
Pushed by jurajo into branch 'master'.

Accept back and forward mouse button events

QtWebEngine engine seems to has its own binding for these buttons in the
mouse release event while Falkon mostly works with mousePress events.

This causes double action on the same button click.

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>

M  +5    -0    src/lib/webengine/webview.cpp

https://invent.kde.org/network/falkon/-/commit/08f7a45021e0cf2c8e571cb89736d071eb0589ef