There is no way to do this using only GTK4, please read this thread for a further discussion: Gtk4 migration - window management functions gone
You will have to use your backend’s API (Xlib, Win32, etc) if you want to continue using this functionality.