After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752250 - Implement 4 finger "switch workspace" swipes for touchpads
Implement 4 finger "switch workspace" swipes for touchpads
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 752248
Blocks:
 
 
Reported: 2015-07-10 19:57 UTC by Carlos Garnacho
Modified: 2015-07-22 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
windowManager: refactor WorkspaceSwitchAction callback into separate function (1.56 KB, patch)
2015-07-10 19:57 UTC, Carlos Garnacho
accepted-commit_now Details | Review
windowManager: Add TouchpadWorkspaceSwitchAction (3.57 KB, patch)
2015-07-10 19:57 UTC, Carlos Garnacho
reviewed Details | Review
windowManager: refactor WorkspaceSwitchAction callback into separate function (1.56 KB, patch)
2015-07-22 19:25 UTC, Carlos Garnacho
none Details | Review
windowManager: Add TouchpadWorkspaceSwitchAction (3.22 KB, patch)
2015-07-22 19:26 UTC, Carlos Garnacho
none Details | Review

Description Carlos Garnacho 2015-07-10 19:57:06 UTC
The clutter evdev backend on master sends events of type CLUTTER_TOUCHPAD_PINCH/SWIPE, we can use the latter in order to have the same 4fg swipe behavior we have on touchscreens.

I'm attaching a patch implementing it as a separate action.
Comment 1 Carlos Garnacho 2015-07-10 19:57:48 UTC
Created attachment 307271 [details] [review]
windowManager: refactor WorkspaceSwitchAction callback into separate function

This will be used too by the touchpad-specific "action", so put it in a
shared place.
Comment 2 Carlos Garnacho 2015-07-10 19:57:53 UTC
Created attachment 307272 [details] [review]
windowManager: Add TouchpadWorkspaceSwitchAction

This object (not really a Clutter.GestureAction) sets up a captured-event
handler, which exclusively looks for 4 finger touchpad swipes, emitting
an ::activated signal under the same terms than WorkspaceSwitchAction.
Comment 3 Florian Müllner 2015-07-22 16:44:15 UTC
Review of attachment 307271 [details] [review]:

Looks good. I *think* the "too" in the commit message is misplaced and should be: "will be used by the [...] action too, ..."
Comment 4 Florian Müllner 2015-07-22 16:45:19 UTC
Review of attachment 307272 [details] [review]:

The activate check looks fishy to me, and somehow a gnome-shell-sass change sneaked into the commit ...

::: js/ui/windowManager.js
@@ +489,3 @@
+            return;
+
+        if (this._dy < MOTION_THRESHOLD)

Shouldn't this be -MOTION_THRESHOLD?

@@ +493,3 @@
+        else if (this._dy > MOTION_THRESHOLD)
+            dir = Meta.MotionDirection.UP;
+        else if (this._dx < MOTION_THRESHOLD)

Dto.

@@ +526,3 @@
+    },
+
+    _init: function(actor) {

Style: should be the first method
Comment 5 Carlos Garnacho 2015-07-22 19:24:15 UTC
(In reply to Florian Müllner from comment #4)
> Review of attachment 307272 [details] [review] [review]:
> 
> The activate check looks fishy to me, and somehow a gnome-shell-sass change
> sneaked into the commit ...

Hmm, both gvc and gnome-shell-sass are out of sync here, not sure I got there...

> 
> ::: js/ui/windowManager.js
> @@ +489,3 @@
> +            return;
> +
> +        if (this._dy < MOTION_THRESHOLD)
> 
> Shouldn't this be -MOTION_THRESHOLD?

Doh right, not sure how this escaped testing

> 
> @@ +493,3 @@
> +        else if (this._dy > MOTION_THRESHOLD)
> +            dir = Meta.MotionDirection.UP;
> +        else if (this._dx < MOTION_THRESHOLD)
> 
> Dto.
> 
> @@ +526,3 @@
> +    },
> +
> +    _init: function(actor) {
> 
> Style: should be the first method

Sure
Comment 6 Carlos Garnacho 2015-07-22 19:25:55 UTC
Created attachment 307928 [details] [review]
windowManager: refactor WorkspaceSwitchAction callback into separate function

This will be used by the touchpad-specific "action" too, so put it in a
shared place.
Comment 7 Carlos Garnacho 2015-07-22 19:26:00 UTC
Created attachment 307929 [details] [review]
windowManager: Add TouchpadWorkspaceSwitchAction

This object (not really a Clutter.GestureAction) sets up a captured-event
handler, which exclusively looks for 4 finger touchpad swipes, emitting
an ::activated signal under the same terms than WorkspaceSwitchAction.
Comment 8 Carlos Garnacho 2015-07-22 19:27:49 UTC
Attachment 307928 [details] pushed as 804563d - windowManager: refactor WorkspaceSwitchAction callback into separate function
Attachment 307929 [details] pushed as f3ecfab - windowManager: Add TouchpadWorkspaceSwitchAction