From 586dff08ec543cdc1600a8f360b3ddbbd819d675 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 4 Jun 2012 00:24:39 -0400 Subject: [PATCH] Clear the entry and use vte_terminal_feed_child. vte_terminal_feed write to the underling vte while vte_terminal_feed_child properly simulates keyboard input. The later is needed, otherwise input can't be erased. --- termite.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/termite.c b/termite.c index 8f319a7..c21902b 100644 --- a/termite.c +++ b/termite.c @@ -72,8 +72,6 @@ static GtkTreeModel *create_completion_model(VteTerminal *vte) { } g_tree_foreach(tree, (GTraverseFunc)add_to_list_store, store); - g_tree_destroy(tree); - g_free(content); return GTK_TREE_MODEL(store); } @@ -108,7 +106,7 @@ static gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, search_p search(VTE_TERMINAL(info->vte), text, true); break; case OVERLAY_COMPLETION: - vte_terminal_feed(VTE_TERMINAL(info->vte), text, -1); + vte_terminal_feed_child(VTE_TERMINAL(info->vte), text, -1); break; case OVERLAY_HIDDEN: break; @@ -137,6 +135,8 @@ static void overlay_show(search_panel_info *info, enum overlay_mode mode, bool c gtk_entry_completion_set_text_column(completion, 0); } + gtk_entry_set_text(GTK_ENTRY(info->entry), ""); + info->mode = mode; gtk_widget_show(GTK_WIDGET(info->panel)); gtk_widget_grab_focus(info->entry); @@ -177,10 +177,6 @@ static gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, search_panel_ overlay_show(info, OVERLAY_COMPLETION, true); return TRUE; } - if (modifiers == GDK_CONTROL_MASK && event->keyval == GDK_KEY_Tab) { - do_entry_completion(vte); - return TRUE; - } return FALSE; }