From 35e0ad72e46e298a55b1a5ac4aee38161051b2fc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 19 Sep 2010 00:54:50 -0400 Subject: [PATCH] Another fix for the initial focus heuristic We were trying to avoid selecting a label initially, but the code was sometimes leaving labels selected when the focus eventually ended up on a button instead. --- gtk/gtkdialog.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 169eb29214..86e28e320d 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -346,15 +346,15 @@ gtk_dialog_map (GtkWidget *widget) g_signal_emit_by_name (window, "move_focus", GTK_DIR_TAB_FORWARD); focus = gtk_window_get_focus (window); + if (GTK_IS_LABEL (focus) && + !gtk_label_get_current_uri (GTK_LABEL (focus))) + gtk_label_select_region (GTK_LABEL (focus), 0, 0); + if (first_focus == NULL) first_focus = focus; else if (first_focus == focus) - { - if (GTK_IS_LABEL (focus) && - !gtk_label_get_current_uri (GTK_LABEL (focus))) - gtk_label_select_region (GTK_LABEL (focus), 0, 0); - break; - } + break; + if (!GTK_IS_LABEL (focus)) break; }