No means to translate argument or return value for 'GskClipNode' (Gtk.Snapshot)
Trying to call to_node
on Gtk.Snapshot
results in the following error:
File "/app/share/re.sonny.Workbench/gdbus_ext.py", line 319, in on_method_call
result = method_func(obj, *args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/share/re.sonny.Workbench/python-previewer.py", line 154, in screenshot
node = snapshot.to_node()
^^^^^^^^^^^^^^^^^^
TypeError: No means to translate argument or return value for 'GskClipNode'
Using GTK 4.
The entire code of the mentioned screenshot
method up to the point it fails:
def screenshot(self, path: str) -> bool:
paintable = Gtk.WidgetPaintable(widget=self.target)
width = self.target.get_allocated_width()
height = self.target.get_allocated_height()
snapshot = Gtk.Snapshot()
paintable.snapshot(snapshot, width, height)
node = snapshot.to_node()
self.target
is any Gtk.Widget
, in this case a Gtk.Box
.
Running in the org.gnome.Platform//45
Flatpak environment. PyGObject 3.46.0
Edited by Marco Köpcke