GNOME Bugzilla – Bug 752250
Implement 4 finger "switch workspace" swipes for touchpads
Last modified: 2015-07-22 19:27:49 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.
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.
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.
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, ..."
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
(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
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.
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.
Attachment 307928 [details] pushed as 804563d - windowManager: refactor WorkspaceSwitchAction callback into separate function Attachment 307929 [details] pushed as f3ecfab - windowManager: Add TouchpadWorkspaceSwitchAction