diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-09-19 00:54:50 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-09-19 00:54:50 -0400 |
commit | 35e0ad72e46e298a55b1a5ac4aee38161051b2fc (patch) | |
tree | 312bf766a84db24837bf4782a63796c79df693e8 /gtk/gtkdialog.c | |
parent | 92411d2c84a24e79798064ec1f834554288c370c (diff) | |
download | gtk+-35e0ad72e46e298a55b1a5ac4aee38161051b2fc.tar.gz |
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.
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r-- | gtk/gtkdialog.c | 12 |
1 files 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; } |