I am using Gtk
and WebKit
from gi.repository
using python on X11 server (on raspbian).
I have a Gtk.OffscreenWindow
with a WebKit.WebView
widget in it and I am looking for a way to get a reference to the actual surface data of the OffscreenWindow
.
Gtk.OffscreenWindow.get_surface
returns a cairo.XlibSurface
object but it doesn't seem there is a way to access pixel data of the surface (get_drawable
is missing).
Gtk.OffscreenWindow.get_pixbuf
returns a pixel buffer but to my understanding this is a copy of the actual surface data.
I used get_snapshot
method of the WebKit.WebView
but it creates a new cairo.ImageSurface
.
My final goal is to use the reference to draw the surface using pi3d and get any surface updates without having to get a new snapshot of the OffscreenWindow
(which is quite slow).