From 800a51b79f2f67f5cc2f0ebb7c62e55a3aa4b1a8 Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 13 Jan 2016 18:11:56 +0100 Subject: [PATCH] Workaround for a gtk bug that removes cursor from a tree view when the search entry becomes empty --- src/selectiondialog.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/selectiondialog.cc b/src/selectiondialog.cc index ff0f143..3b19342 100644 --- a/src/selectiondialog.cc +++ b/src/selectiondialog.cc @@ -179,6 +179,10 @@ void SelectionDialog::show() { *search_key=search_entry.get_text(); filter_model->refilter(); list_view_text.set_search_entry(search_entry); //TODO:Report the need of this to GTK's git (bug) + if(search_key->empty()) { + if(list_view_text.get_model()->children().size()>0) + list_view_text.set_cursor(list_view_text.get_model()->get_path(list_view_text.get_model()->children().begin())); + } }); search_entry.signal_event().connect([this](GdkEvent* event) {