aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-08-11 22:10:01 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-08-11 22:10:01 +0800
commit9c072559904fb7a7807b3755f760b312d06f23b4 (patch)
tree0c754c8083773d65fa90c4bbec044ffbb3fc54ed
parentf2fba09301e6e4eaf26556a61d3b6d99cf769f30 (diff)
downloadgsoc2013-evolution-9c072559904fb7a7807b3755f760b312d06f23b4.tar.gz
gsoc2013-evolution-9c072559904fb7a7807b3755f760b312d06f23b4.tar.zst
gsoc2013-evolution-9c072559904fb7a7807b3755f760b312d06f23b4.zip
remove select-on-focus hack, and replace with new skip-a-parent
chaining hack; sub-set this only for when we have a hint visible ie. fix alt-c + type-new-search
-rw-r--r--widgets/misc/e-hinted-entry.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/widgets/misc/e-hinted-entry.c b/widgets/misc/e-hinted-entry.c
index 934c65a6d3..355d9bf0e3 100644
--- a/widgets/misc/e-hinted-entry.c
+++ b/widgets/misc/e-hinted-entry.c
@@ -126,29 +126,16 @@ hinted_entry_finalize (GObject *object)
static void
hinted_entry_grab_focus (GtkWidget *widget)
{
- EHintedEntryPrivate *priv;
- GtkSettings *settings;
- const gchar *property_name;
- gboolean select_on_focus;
-
- priv = E_HINTED_ENTRY_GET_PRIVATE (widget);
-
- /* We don't want hints to be selected so we must temporarily
- * override the "gtk-entry-select-on-focus" setting. */
+ GtkWidgetClass *chain_class;
- settings = gtk_widget_get_settings (widget);
- property_name = "gtk-entry-select-on-focus";
-
- g_object_get (settings, property_name, &select_on_focus, NULL);
-
- if (priv->hint_shown)
- g_object_set (settings, property_name, FALSE, NULL);
+ /* We don't want hints to be selected so we chain to
+ * the GtkEntry parent if we have a hint set */
+ chain_class = parent_class;
+ if (e_hinted_entry_get_hint_shown (E_HINTED_ENTRY (widget)))
+ chain_class = g_type_class_peek_parent (chain_class);
/* Chain up to parent's grab_focus() method. */
- GTK_WIDGET_CLASS (parent_class)->grab_focus (widget);
-
- if (priv->hint_shown)
- g_object_set (settings, property_name, select_on_focus, NULL);
+ GTK_WIDGET_CLASS (chain_class)->grab_focus (widget);
}
static gboolean