List all current windows open...?

Is there a way to list all of the current windows open? For example,
I’d like to find all Firefox windows and minimize them. I’ve tried
looking in Gtk::Window.toplevels but it’s empty and
Gdk::Window.toplevels only contains a single window with no children.

Any advice?

Thanks.