Gtk.Widget.prototype.is_ancestor

function is_ancestor(ancestor:Gtk.Widget):Boolean {
    // Gjs wrapper for gtk_widget_is_ancestor()
}

Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.

ancestor

another Gtk.Widget

Returns

true if ancestor contains widget as a child, grandchild, great grandchild, etc.