From 65a03eb441448e33f23112264fd645e998badbf3 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 12 Jun 2026 12:03:36 -0400 Subject: [PATCH] Fixed a bug in the run dialogue script. --- scripts/run_dialog.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/run_dialog.py b/scripts/run_dialog.py index 7bed78e..d5e8908 100755 --- a/scripts/run_dialog.py +++ b/scripts/run_dialog.py @@ -314,7 +314,7 @@ class RunDialog(Gtk.Window): window_accessible.set_name(APP_NAME) window_accessible.set_description( "Type to find commands and applications. Type a path to browse files. " - "Use up and down arrows to select a result, Tab to insert a result, " + "Use up and down arrows to select a result, Tab to insert the selected result, " "and Enter to open it." ) self.entry.get_accessible().set_name("Command, application, or file") @@ -341,8 +341,7 @@ class RunDialog(Gtk.Window): for result in self.results: self.store.append((result.label, result.detail)) - if self.results: - self.view.get_selection().select_path(0) + self.view.get_selection().unselect_all() self.schedule_result_feedback(len(self.results)) def set_status(self, message): @@ -509,8 +508,11 @@ class RunDialog(Gtk.Window): def on_entry_key_press(self, _entry, event): if event.keyval in (Gdk.KEY_Down, Gdk.KEY_Up): self.view.grab_focus() - if event.keyval == Gdk.KEY_Up and self.results: - self.view.get_selection().select_path(len(self.results) - 1) + if self.results: + if event.keyval == Gdk.KEY_Up: + self.view.get_selection().select_path(len(self.results) - 1) + else: + self.view.get_selection().select_path(0) return True if event.keyval == Gdk.KEY_Tab: self.insert_selected_result()