diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-07-19 15:44:23 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-07-19 15:44:23 +0000 |
commit | 6a45d5b825b17996265263714a137352aa0ba246 (patch) | |
tree | 42ca911bc8ed3ffbf528f15f266a6e86a146682c | |
parent | e1926de86a5a16dd63849b7f70658bd6af174cf3 (diff) | |
download | gtk+-6a45d5b825b17996265263714a137352aa0ba246.tar.gz |
Handle keypresses better when there is no completion. (#458298, Christian
2007-07-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_completion_key_press): Handle
keypresses better when there is no completion. (#458298,
Christian Persch, patch by Xan Lopez)
* gtk/gtkentrycompletion.c
(gtk_entry_completion_insert_completion_text): Small cleanup.
svn path=/trunk/; revision=18505
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gtk/gtkentry.c | 8 | ||||
-rw-r--r-- | gtk/gtkentrycompletion.c | 3 |
3 files changed, 19 insertions, 1 deletions
@@ -1,5 +1,14 @@ 2007-07-19 Matthias Clasen <mclasen@redhat.com> + * gtk/gtkentry.c (gtk_entry_completion_key_press): Handle + keypresses better when there is no completion. (#458298, + Christian Persch, patch by Xan Lopez) + + * gtk/gtkentrycompletion.c + (gtk_entry_completion_insert_completion_text): Small cleanup. + +2007-07-19 Matthias Clasen <mclasen@redhat.com> + * gtk/gtksettings.c (apply_queued_setting): Merge color scheme before sending notification. diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 6dba110ed1..01d65b545c 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -5893,9 +5893,17 @@ gtk_entry_completion_key_press (GtkWidget *widget, event->keyval == GDK_Right || event->keyval == GDK_KP_Right) { + GtkTreeSelection *sel; + GtkTreeIter iter; + GtkTreeModel *model = NULL; + _gtk_entry_reset_im_context (GTK_ENTRY (widget)); _gtk_entry_completion_popdown (completion); + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view)); + if (!gtk_tree_selection_get_selected (sel, &model, &iter)) + return FALSE; + if (completion->priv->inline_selection) { /* Escape rejects the tentative completion */ diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 8c4268a794..e3dd01fdad 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1690,7 +1690,8 @@ gtk_entry_completion_insert_completion_text (GtkEntryCompletion *completion, if (completion->priv->completion_prefix == NULL) completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->entry))); - gtk_entry_set_text (GTK_ENTRY (priv->entry), text); + + gtk_entry_set_text (GTK_ENTRY (priv->entry), text); len = strlen (priv->completion_prefix); gtk_editable_select_region (GTK_EDITABLE (priv->entry), len, -1); |