Forcing an Actor to be repainted at a specific refresh rate

I’m implementing a GLSLEffect that gets data from an outside source (a head-tracking device, IMU positional data) and needs to redraw the actor at a specific refresh rate to reflect the changes that the data is describing, because the changes in the actor should smoothly follow the head-tracking from the external device.

The problem is probably obvious: GNOME likes to cache actor contents and only repaint if they’re dirty. From my extension’s point of view, when new IMU data is present, the actor content IS dirty because it no longer reflects what should be seen, but I don’t know how to properly trigger that at the refresh rate I’d like.

I’m currently doing this a really awful way with GLib.timeout_add() calling queue_redraw() (as seen here) and I’m looking for a more correct way to trigger that.

Thanks!