demo: only set transient if demo returns a toplevel

This commit is contained in:
William Jon McCann 2013-12-09 09:55:08 +01:00
parent 35a249466f
commit 7ba0083fc9

View File

@ -142,8 +142,11 @@ activate_run (GSimpleAction *action,
cbdata->model = model; cbdata->model = model;
cbdata->path = gtk_tree_model_get_path (model, &iter); cbdata->path = gtk_tree_model_get_path (model, &iter);
gtk_window_set_transient_for (GTK_WINDOW (demo), GTK_WINDOW (window)); if (gtk_widget_is_toplevel (demo))
gtk_window_set_modal (GTK_WINDOW (demo), TRUE); {
gtk_window_set_transient_for (GTK_WINDOW (demo), GTK_WINDOW (window));
gtk_window_set_modal (GTK_WINDOW (demo), TRUE);
}
g_signal_connect (demo, "destroy", g_signal_connect (demo, "destroy",
G_CALLBACK (window_closed_cb), cbdata); G_CALLBACK (window_closed_cb), cbdata);