summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index cb49c4a..03dc31e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1246,6 +1246,14 @@ int main(int argc, char *argv[])
uint32_t selection = tofi.window.entry.selection;
char *res = tofi.window.entry.results.buf[selection].string;
if (tofi.window.entry.drun) {
+ /*
+ * TODO: This is ugly. The list of apps
+ * needs to be sorted alphabetically
+ * for bsearch to find the selected
+ * entry, but we previously sorted by
+ * history count. This needs fixing.
+ */
+ desktop_vec_sort(&tofi.window.entry.apps);
struct desktop_entry *app = desktop_vec_find(&tofi.window.entry.apps, res);
if (app == NULL) {
log_error("Couldn't find application file! This shouldn't happen.\n");