+/**
+ * gtk_window_set_destroy_with_parent:
+ * @window: a #GtkWindow
+ * @setting: whether to destroy @window with its transient parent
+ *
+ * If @setting is TRUE, then destroying the transient parent of @window
+ * will also destroy @window itself. This is useful for dialogs that
+ * shouldn't persist beyond the lifetime of the main window they're
+ * associated with, for example.
+ **/
+void
+gtk_window_set_destroy_with_parent (GtkWindow *window,
+ gboolean setting)
+{
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
+ if (window->destroy_with_parent == (setting != FALSE))
+ return;
+
+ if (window->destroy_with_parent)
+ {
+ disconnect_parent_destroyed (window);
+ }
+ else
+ {
+ connect_parent_destroyed (window);
+ }
+
+ window->destroy_with_parent = setting;
+}
+