From ba377bb0e16c6773dd13632bc4793dae58a59e06 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 15 Sep 2005 12:29:03 +0000 Subject: Don't focus the checkbox initially. Fixes bug #163371. 2005-09-15 Christian Persch * embed/mozilla/GtkNSSDialog.cpp: Don't focus the checkbox initially. Fixes bug #163371. --- embed/mozilla/GtkNSSDialogs.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp index b8a47a402..44b6897e2 100644 --- a/embed/mozilla/GtkNSSDialogs.cpp +++ b/embed/mozilla/GtkNSSDialogs.cpp @@ -204,9 +204,12 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx, gboolean *checkbox_value, const char *affirmative_text) { - GtkWidget *dialog, *label, *checkbox, *vbox; + GtkWidget *dialog, *label, *checkbox, *vbox, *button; int res; + /* NOTE: Due to a mozilla bug [https://bugzilla.mozilla.org/show_bug.cgi?id=306288], + * we will always end up without a parent! + */ nsCOMPtr parent = do_GetInterface (ctx); GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent)); @@ -240,9 +243,9 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx, affirmative_text = _("_Accept"); } - gtk_dialog_add_button (GTK_DIALOG (dialog), - affirmative_text, - GTK_RESPONSE_ACCEPT); + button = gtk_dialog_add_button (GTK_DIALOG (dialog), + affirmative_text, + GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); if (checkbox_text) @@ -258,6 +261,9 @@ display_cert_warning_box (nsIInterfaceRequestor *ctx, checkbox = 0; } + /* We don't want focus on the checkbox */ + gtk_widget_grab_focus (button); + gtk_label_set_markup (GTK_LABEL (label), markup_text); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); gtk_widget_show_all (dialog); -- cgit v1.2.3