diff --git a/ChangeLog b/ChangeLog index bb69c3515d..e53f1cfb10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-05-24 Matthias Clasen + * 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) + * gtk/gtkprintunixdialog.c (create_main_page): Make the range entry insensitive if another range option is selected. (#342783, Caolan McNamara) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bb69c3515d..e53f1cfb10 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,10 @@ 2006-05-24 Matthias Clasen + * 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) + * gtk/gtkprintunixdialog.c (create_main_page): Make the range entry insensitive if another range option is selected. (#342783, Caolan McNamara) diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c index ac2c6d3154..a917cd22f5 100644 --- a/gtk/gtkcolorbutton.c +++ b/gtk/gtkcolorbutton.c @@ -710,9 +710,14 @@ gtk_color_button_clicked (GtkButton *button) color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog); - if (parent) - gtk_window_set_transient_for (GTK_WINDOW (color_dialog), - GTK_WINDOW (parent)); + if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent)) + { + if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (color_dialog))) + gtk_window_set_transient_for (GTK_WINDOW (color_dialog), GTK_WINDOW (parent)); + + gtk_window_set_modal (GTK_WINDOW (color_dialog), + gtk_window_get_modal (GTK_WINDOW (parent))); + } g_signal_connect (color_dialog->ok_button, "clicked", G_CALLBACK (dialog_ok_clicked), color_button); @@ -720,10 +725,6 @@ gtk_color_button_clicked (GtkButton *button) G_CALLBACK (dialog_cancel_clicked), color_button); g_signal_connect (color_dialog, "destroy", G_CALLBACK (dialog_destroy), color_button); - - /* If there is a grabbed window, set new dialog as modal */ - if (gtk_grab_get_current ()) - gtk_window_set_modal (GTK_WINDOW (color_button->priv->cs_dialog),TRUE); } color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog); 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);