How can I include the popover in my screenshot?

Hi, I’m using gtkmm4 and when I create a screenshot of my app (using Gtk Snapshot) the image contains contain everything but the popover which is open at the time.
Unfortunately I need an exact screenshot of what the user sees.
How can I include the popover in my screenshot?

Use Kooha, set recording to GIF, and extract a frame with popover.

Thx, but I use GTK:Snapshot for this, it’s really strange that the popover is not included

It’s not really strange: the popover uses a separate surface.

You will need to compose the snapshot yourself, by going through every widget backed by a native surface.

Can I pass a single snapshot to both the main window and all the popovers? or would I need one for each object that derives from Gtk::Native?

No, you can’t: widgets that implement GtkNative have a different renderer. If you call gtk_widget_child_snapshot() on a widget that implements GtkNative, the call will bail out immediately.

You’re supposed to render every widget implementing GtkNative separately, and then compose the result using the coordinates each native has.

I’m trying to end up with one unified image of all of my gui. ATM I take the renderer of my Gtk::Window snapshot, get its texture using gsk_renderer_render_texture(), and then the buffer using gdk_texture_download(). Can I somehow combine the snapshots(or nodes?) of my popovers and window to get this final result?

Hi @ebassi ,

How would you suggest to compose the result?
Also, to which signal on which widget should we register so that our handler would manage to access all the GtkNative widgets together to call gtk_widget_child_snapshot?

Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.