0

Trying to connect a StButton to a swipe signal, I get an error:

JS ERROR: Extension screensaver-dashboard@singularities.org: Error: No signal 'swipe' on object 'StButton

However, I can see the signal among Clutter Actions https://developer.gnome.org/clutter/stable/ClutterSwipeAction.html#ClutterSwipeAction.signals

Maybe it is not supported yet? O should I use another kind of StWidget to connecting to swipe signal?

Antonio Tapiador
  • 4,326
  • 1
  • 15
  • 8

1 Answers1

1

StWidget is a ClutterActor which has no swipe signal.

The signal you want to connect to is on a ClutterSwipeAction so you probably want to create a new one, connect to the swipe signal on that object, then add the action to the actor.

andy.holmes
  • 3,383
  • 17
  • 28
  • I just tested it, the code worked, but it didn't show anything. I tested it both with a `St.Label` and a `St.Button` ` const swipeAction = new Clutter.SwipeAction() swipeAction.connect('swipe', this._onTemperatureSetpointChange.bind(this)) this._layout.livingRoomSelect.add_action(swipeAction) _onTemperatureSetpointChange() { log('onSwipe') } ` – Antonio Tapiador Apr 09 '20 at 11:01
  • Sorry, I've never use `ClutterSwipeAction` or other gestures before. It may be you have to add a `Clutter.GestureAction` for `swipe` to be emitted on your action. You might want to search through some gnome-shell code to see how they use gestures and actions there. – andy.holmes Apr 09 '20 at 18:35
  • Sorry, I cannot find any examples. I think the code is right but the actions are not recognized. Using `GestureAction` and connecting to `gesture-begin` works. Using `TapAction` and `gesture-begin` works, but connecting to `tap` does not. Using `PanAction` (more relaxed than `SwipeAction`) does not work, not `pan` neither `gesture-begin` – Antonio Tapiador Apr 09 '20 at 20:43