]> Pileus Git - ~andy/gtk/commitdiff
Only call g_object_get() when necessary. (#373137, Morten Welinder, patch
authorMatthias Clasen <mclasen@redhat.com>
Sat, 28 Apr 2007 17:53:50 +0000 (17:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 28 Apr 2007 17:53:50 +0000 (17:53 +0000)
2007-04-28  Matthias Clasen  <mclasen@redhat.com>

        * 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
gtk/gtkentry.c

index 4c1f183b7fa8d00e87e0b7a3fea9464b44080f36..785f47d86a05cce50e8ba519e13f898fda5c9ddb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-28  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <mclasen@redhat.com>
 
        * gtk/gtkstatusicon.c (gtk_status_icon_get_size): Add
index 2a52c18b6ff151b3002b3193408014b7122d2db7..9935340785113c5af83502e829563c3d184c0ad9 100644 (file)
@@ -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