diff --git a/qrexec/tools/qrexec_policy_agent.py b/qrexec/tools/qrexec_policy_agent.py index fb92a423..0d8b724e 100644 --- a/qrexec/tools/qrexec_policy_agent.py +++ b/qrexec/tools/qrexec_policy_agent.py @@ -184,11 +184,22 @@ def apply_model( completion.set_inline_selection(True) completion.set_inline_completion(True) completion.set_popup_completion(True) - completion.set_popup_single_match(False) + completion.set_popup_single_match(True) completion.set_model(list_store) completion.set_text_column(1) entry_box.set_completion(completion) + + def qube_matching_function(completion: Gtk.EntryCompletion, + key: str, + iterator: Gtk.TreeIter, + user_data: object) -> bool: + # pylint: disable=unused-argument + modelstr = completion.get_model()[iterator][1] + return key.lower() in modelstr.lower() + + completion.set_match_func(qube_matching_function, None) + if activation_trigger: entry_box.connect( "activate",