To do this in GTK, you need to call

gtk_window_set_type_hint((GtkWindow*)windowname, GDK_WINDOW_TYPE_HINT_DIALOG);

https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-type-hint

i3 will take window hints, and if a window tells i3 it is a dialog window, it will make it float automatically.