gnomecluttergnome-shellgnome-shell-extensionsgjs

How to Create Clutter events with GJS


I will receive {x,y} data from the network corresponding to a pixel coordinate.

I would like to create clutter event or at least inform the system (clutter stage) there is a mouse move to the received {x,y} data.

I had a look on the unofficial GJS documentation: http://www.roojs.com/seed/gir-1.2-gtk-3.0/seed/Clutter.Event.html

ev = new Clutter.Event(); // or Clutter.Event(Clutter.TouchEvent) are not working

Solution

  • You cannot create events in GJS, because the ClutterEvent data structure is not really introspectable, for a bunch of historical reasons.

    On top of that, creating ClutterEvents is not something you should do; events come from the windowing system, and you cannot just synthesize them on client-side code and expect Clutter to actually work as usual.