[gtk+/gtk-3-4] entry-completion: don't move to leftmost character with inline-selection
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-4] entry-completion: don't move to leftmost character with inline-selection
- Date: Sun, 15 Jul 2012 17:00:25 +0000 (UTC)
commit 6f6b5c81eaf3686f18825e3da8a69a480e596070
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Jun 12 00:13:55 2012 -0400
entry-completion: don't move to leftmost character with inline-selection
When inline-selection is set, and the completion popup is showing,
pressing left abruptly jumps to the beginning of the entry text.
This is not expected, since the cursor is at the end of the text before
the left key is pressed, and this behavior is completely inconsistent
with how an entry would normally behave.
The behavior can be observed in Epiphany by selecting a completion match
and pressing left.
This patch changes the code so that it just runs the default entry key
press keybindings in such a case.
https://bugzilla.gnome.org/show_bug.cgi?id=677915
gtk/gtkentry.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 0d27451..3636c4e 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -9557,14 +9557,15 @@ gtk_entry_completion_key_press (GtkWidget *widget,
gtk_entry_set_text (GTK_ENTRY (completion->priv->entry), "");
}
- /* Move the cursor to the end for Right/Esc, to the
- beginning for Left */
+ /* Move the cursor to the end for Right/Esc */
if (event->keyval == GDK_KEY_Right ||
event->keyval == GDK_KEY_KP_Right ||
event->keyval == GDK_KEY_Escape)
gtk_editable_set_position (GTK_EDITABLE (widget), -1);
+ /* Let the default keybindings run for Left, i.e. either move to the
+ * previous character or select word if a modifier is used */
else
- gtk_editable_set_position (GTK_EDITABLE (widget), 0);
+ retval = FALSE;
}
keypress_completion_out:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]