Gtk4 Migration gdk_pixbuf_get_from_window

I’m porting one of my apps to Gtk4 - so far so good - most of the docs are really good, and not too many issues.

However I got a bit stuck on gdk_pixbuf_get_from_window (I use it to create screenshots of the app while running)

The migration docs say

" These functions are not supported in GTK 4. Instead, either use backend-specific APIs, or render your widgets using Gtk.WidgetClass.snapshot, once you are using GTK 4.`"

I’m guessing ‘backend-specific’ - means X11 or Wayland - Any pointers to functions I should be looking at to implement it?

I probably don’t want to re-render the whole application to a Snapshot Widget? - again could not find any examples of Snapshot being used anywhere? - are there any

Anyway - Thanks for any advice.

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