[gtk+] Another fix for the initial focus heuristic
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Another fix for the initial focus heuristic
- Date: Sun, 19 Sep 2010 04:56:43 +0000 (UTC)
commit 35e0ad72e46e298a55b1a5ac4aee38161051b2fc
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Sep 19 00:54:50 2010 -0400
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 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 169eb29..86e28e3 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]