How to get parent Window reference for GTK 4 Widget?

In GTK3 available this method:

Wat about GTK4?

I’m working with gtkmm (dialog feature), can’t find any relationships in autocomplete, maybe another implementation wanted.

Native windowing system surfaces are only available on the root widget:

GtkNative *native = gtk_widget_get_native (widget);
GdkSurface *surface = gtk_native_get_surface (native);

In general, there should be a lot fewer reasons why you end up using a GdkSurface in GTK4, compared to GTK3, so any time you end up doing that you should ask yourself what are you actually trying to achieve.

1 Like