I’m trying to port Evince to gtk4 and I encountered an issue. The recent view widget of Evince is just a GtkIconView drawing previews (cairo_surface_t) of PDF thumnails. Since the old
surface property is dropped for GtkCellRendererPixbuf in Gtk4, the only viable way to draw cairo_surface_t is the
texture property which requires a GtkTexture. I know there is a
gdk_memory_texture_new function to construct such GdkTexture. But there is also a private function named
gdk_texture_new_for_surface. So what is the reason to keep this function private to gtk? Is there any simpler way to turn a cairo_surface_t into a GtkTexture?