From 08c05b1bcc716d36589890d22b2fe59f80ee4ece Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 28 Apr 2007 17:53:50 +0000 Subject: [PATCH] Only call g_object_get() when necessary. (#373137, Morten Welinder, patch 2007-04-28 Matthias Clasen * gtk/gtkentry.c (gtk_entry_grab_focus): Only call g_object_get() when necessary. (#373137, Morten Welinder, patch by Xan Lopez) svn path=/trunk/; revision=17678 --- ChangeLog | 6 ++++++ gtk/gtkentry.c | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c1f183b7f..785f47d86a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-28 Matthias Clasen + + * gtk/gtkentry.c (gtk_entry_grab_focus): Only call + g_object_get() when necessary. (#373137, Morten Welinder, + patch by Xan Lopez) + 2007-04-28 Matthias Clasen * gtk/gtkstatusicon.c (gtk_status_icon_get_size): Add diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 2a52c18b6f..9935340785 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -2146,13 +2146,16 @@ gtk_entry_grab_focus (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_entry_parent_class)->grab_focus (widget); - g_object_get (gtk_widget_get_settings (widget), - "gtk-entry-select-on-focus", - &select_on_focus, - NULL); + if (entry->editable && !entry->in_click) + { + g_object_get (gtk_widget_get_settings (widget), + "gtk-entry-select-on-focus", + &select_on_focus, + NULL); - if (select_on_focus && entry->editable && !entry->in_click) - gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); + if (select_on_focus) + gtk_editable_select_region (GTK_EDITABLE (widget), 0, -1); + } } static void