Bug 378021

Summary: Gwenview should support trackpad pinch-to-zoom gestures
Product: [Applications] gwenview Reporter: Nate Graham <nate>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: 842mono, bharadwaj.raju777, bugseforuns, myriam, nate
Priority: HI Keywords: usability
Version: 16.12.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 23.04
Sentry Crash Report:

Description Nate Graham 2017-03-24 16:00:02 UTC
Gwenview 16.12.3 with KDE Plasma 5.9.3 on openSUSE Tumbleweed. 

Gwenview doesn't seem to support pinch-to-zoom, either from my laptop's trackpad or touchscreen. It does support panning correctly (two-finger pan on the trackpad, one-finger on the touchscreen).

I'm using the synaptics driver, not libinput.
Comment 1 Nate Graham 2017-03-29 03:03:11 UTC
No change if I use libinput instead.
Comment 2 Nate Graham 2017-10-19 19:02:06 UTC
Swipe and pinch gestures were added to Okular in the following commits:

- Swipe: https://cgit.kde.org/okular.git/commit/?id=618072f8a2ea77ba7ad1241abac088487dee04b3

- Pinch: https://cgit.kde.org/okular.git/commit/?id=9d90a08ef5e22d682a5a5004128f72d1a5a84aff

I wonder if I can learn from those and do the same for Gwenview.
Comment 3 Patrick Silva 2019-02-01 21:09:21 UTC
*** Bug 403801 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2019-03-16 10:52:14 UTC
Git commit 603fd1e1b7e92be9084793d9c87bb220d1ee550b by Nate Graham, on behalf of Steffen Hartleib.
Committed on 16/03/2019 at 10:52.
Pushed by ngraham into branch 'master'.

Touch support for Gwenview

Summary:
Add touch support for Gwenview. At moment one finger scrolling, pinch gesture for zoom and rotate and one finger
swipe gesture to go to next or previous image is working with some little issue.

It is my first time I am modify the source code, so if I make same mistake please let me now.

Test Plan:
Browse mode
===========
* test, if mouse and touchpad working as previously: scrolling, selection and drag and drop

all follow tests with touchscreen:
    * on finger scrolling, test if uwanted drag events or selection events occur
    * two finger scrolling, test if uwanted drag events or selection events occur
    * test drag and drop action (need a TabAndHold gesture before moving the touch point)
    * pinch gesture for zoom, check sensitive and unwanted behavior
    * check double touch, if system setting is set to: open file or directory with a double click

View Mode
=========
* test, if mouse and touchpad working as previously: scrolling, selection and drag and drop

all follow tests with touchscreen:
    * one finger panning, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger panning, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * one finger swipe gesture, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger swipe gesture, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * pinch gesture for zoom and rotate, check sensitive and unwanted behavior
    * drag and drop action (need a TabAndHold gesture before moving the touch point)
    * test double touch to toggle between view mode and fullscreen mode.

Thumbnail bar in view Mode:
===========================
* test, if mouse and touchpad working as previously: scrolling, selection and drag and drop

all follow tests with touchscreen:
    * one finger scrolling, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger scrolling, test if uwanted drag events or selection events occur
    * drag and drop action (need a TabAndHold gesture before moving the touch point)

Fullscreen Mode
===============
* test, if mouse and touchpad working as previously: scrolling, selection and drag and drop

all follow tests with touchscreen:
    * one finger panning, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger panning,  check if unwanted drag events or image modifying events (zoom/rotate) occur
    * one finger swipe gesture, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger swipe gesture, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * pinch gesture for zoom and rotate, check sensitive and unwanted behavior
    * drag and drop action (need a TabAndHold gesture before moving the touch point)
    * check if you get access to the fullscreen thumbnail bar on the top screen border

Thumbnail bar in fullscreen Mode:
===========================
* test, if mouse and touchpad working as previously: scrolling, selection and drag and drop

all follow tests with touchscreen:
    * one finger scrolling, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * two finger scrolling, check if unwanted drag events or image modifying events (zoom/rotate) occur
    * drag and drop action (need a TabAndHold gesture before moving the touch point)

Reviewers: #gwenview, ngraham, muhlenpfordt

Reviewed By: #gwenview, ngraham

Subscribers: volkov, asturmlechner, sander, ngraham, rkflx

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D13901

M  +19   -0    app/folderviewcontextmanageritem.cpp
M  +15   -0    app/startmainpage.cpp
M  +2    -0    app/startmainpage.h
M  +8    -0    lib/CMakeLists.txt
M  +79   -0    lib/documentview/documentview.cpp
M  +11   -0    lib/documentview/documentview.h
A  +44   -0    lib/scrollerutils.cpp     [License: GPL]
A  +38   -0    lib/scrollerutils.h     [License: GPL]
M  +47   -0    lib/thumbnailview/thumbnailview.cpp
M  +8    -0    lib/thumbnailview/thumbnailview.h
A  +127  -0    lib/touch/doubletap.cpp     [License: GPL]
A  +59   -0    lib/touch/doubletap.h     [License: GPL]
A  +123  -0    lib/touch/oneandtwofingerswipe.cpp     [License: GPL]
A  +62   -0    lib/touch/oneandtwofingerswipe.h     [License: GPL]
A  +129  -0    lib/touch/tapholdandmoving.cpp     [License: GPL]
A  +63   -0    lib/touch/tapholdandmoving.h     [License: GPL]
A  +464  -0    lib/touch/touch.cpp     [License: GPL]
A  +99   -0    lib/touch/touch.h     [License: GPL]
A  +69   -0    lib/touch/touch_helper.cpp     [License: GPL]
A  +67   -0    lib/touch/touch_helper.h     [License: GPL]
A  +165  -0    lib/touch/twofingerpan.cpp     [License: GPL]
A  +66   -0    lib/touch/twofingerpan.h     [License: GPL]
A  +117  -0    lib/touch/twofingertap.cpp     [License: GPL]
A  +59   -0    lib/touch/twofingertap.h     [License: GPL]

https://commits.kde.org/gwenview/603fd1e1b7e92be9084793d9c87bb220d1ee550b
Comment 6 Nate Graham 2022-12-23 21:11:12 UTC
Git commit e39a0b2b9ddc84842e43cc45039e378008e3eb05 by Nate Graham, on behalf of Bharadwaj Raju.
Committed on 23/12/2022 at 21:11.
Pushed by ngraham into branch 'master'.

Implement Touchpad pinch-to-zoom feature on Wayland

Adds support for pinch-to-zoom using the touchpad on Wayland, through the
pointer-gestures-unstable-v1 Wayland protocol.

Thanks to Carl Schwan for writing the initial version of the Wayland protocol
interface code here.
FIXED-IN: 23.04

M  +15   -0    CMakeLists.txt
M  +1    -0    config-gwenview.h.cmake
M  +25   -0    lib/CMakeLists.txt
M  +21   -0    lib/documentview/documentview.cpp
A  +127  -0    lib/waylandgestures/waylandgestures.cpp     [License: GPL]
A  +55   -0    lib/waylandgestures/waylandgestures.h     [License: GPL]

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