summaryrefslogtreecommitdiff
path: root/gtk/gtkfontbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-05-24 19:44:20 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-05-24 19:44:20 +0000
commit685d8ecfce09dbfb8e56eb08d1995e2e31a6e83f (patch)
tree113b6c5c79652e0873e68f70d0cb91ff9dfb8541 /gtk/gtkfontbutton.c
parentd6f2aadab7dcd677f20b5b8cbf2876d2366299eb (diff)
downloadgtk+-685d8ecfce09dbfb8e56eb08d1995e2e31a6e83f.tar.gz
Fix the handling of modality by copying what GtkFileChooserButton does.
2006-05-24 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfontbutton.c (gtk_font_button_clicked): * gtk/gtkcolorbutton.c (gtk_color_button_clicked): Fix the handling of modality by copying what GtkFileChooserButton does. (#342754, Yevgen Muntyan)
Diffstat (limited to 'gtk/gtkfontbutton.c')
-rw-r--r--gtk/gtkfontbutton.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 59f4b20e98..2f1814434f 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -697,12 +697,14 @@ gtk_font_button_clicked (GtkButton *button)
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
-
- /* If there is a grabbed window, set new dialog as modal */
- if (gtk_grab_get_current ())
- gtk_window_set_modal (GTK_WINDOW (font_dialog), TRUE);
+ if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent))
+ {
+ if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (font_dialog)))
+ gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
+
+ gtk_window_set_modal (GTK_WINDOW (font_dialog),
+ gtk_window_get_modal (GTK_WINDOW (parent)));
+ }
g_signal_connect (font_dialog->ok_button, "clicked",
G_CALLBACK (dialog_ok_clicked), font_button);